Commit Graph

56 Commits

Author SHA1 Message Date
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Jendrik
d39db26c26 add 'throw' to the strict option for schemas 2018-02-12 15:14:46 +01:00
Andy
bef4d2b27d
Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
Mykola
cd92f62f15 Fix typo (#23277) 2018-01-31 12:20:20 -08:00
Art
ccdc539cc4 Add: Mongoose 5 types (#23070)
* move v4 types

* add newline-per-chained-call tslint rule to avoi having to refactor the entire test file

* mongoose 5 types

* update SchemaToObjectOptions

* reuse toObject definition, add it to schema options, remove retainKeyOrder

* add paths to mongoose-deep-populate

* rm a no longer supported createConnection signature

* Object -> any @ mongoose 4

* object ->any @ mongoose 5

* rm todo comment

* rm Mongoose thenable type

* Add changes between 4.7 and 5.0

* Add path to mongoose/v4 to all dependent projects

* fix dropDatabase() brainfart.

* Add more missing methods

* rm newline-chained-call rule from tslint

* Revert "Add path to mongoose/v4 to all dependent projects"

This reverts commit 162b8ad
2018-01-26 13:32:00 -08:00
Andrew Stiegmann
d512b1f5d1 Add usePushEach flag to Mongoose Schema Options (#23042)
In order for devs to be able to work around the issues described in
https://github.com/Automattic/mongoose/issues/5574 we need to be able
to supply the `usePushEach` flag to the Mongoose SchemaOptions. This
options functionality is described in
https://github.com/Automattic/mongoose/issues/4455 and is required for
anyone who modifies arrays inline who is using Mongoose 4 and MongoDB
3.6+

Testing:
  Copied changes to local project and verified compilation worked.
2018-01-19 10:15:29 -08:00
Andy
01d4dcdcd2
Fix 'no-dynamic-delete' lint failures (#22822) 2018-01-10 15:01:26 -08:00
Stefan
f40ab95d05 Updated Model types (#22532)
Updated the Mongoose Model type to include the new (updateOne)[http://mongoosejs.com/docs/api.html#model_Model.updateOne], (updateMany)[http://mongoosejs.com/docs/api.html#model_Model.updateMany], (deleteOne)[http://mongoosejs.com/docs/api.html#model_Model.deleteOne], (deleteMany)[http://mongoosejs.com/docs/api.html#model_Model.deleteMany] methods.
2018-01-02 12:27:49 -08:00
Paul van Brenk
bdd1f8a127
Merge pull request #22333 from kolya182/mongoose-readme-static-typo
mongoose: Fix typo for static methods
2017-12-28 11:55:04 -08:00
Paul van Brenk
2bb699e64b
Merge pull request #22250 from simonxca/pre-mongoose
Mongoose: Use v3 function signature for schema pre method
2017-12-27 15:53:29 -08:00
Mykola Radchenko
1ff7302d0f mongoose: Fix typo for static methods 2017-12-19 20:43:41 -08:00
Arthur Ozga
161184f128
Merge pull request #21856 from simonxca/fix-mongoose
Set mongoose document id property to any
2017-12-19 16:10:13 -08:00
simonxca
5a4fc269cc Update comment on id property 2017-12-17 23:55:30 -08:00
simonxca
a9479a5c50 Use v3 function signature for pre method
Fixes #21938
The new signatures were confusing and caused some backwards breaking changes.
2017-12-16 19:08:26 -08:00
Gregor Yushinov
24ea09d1a5 Fixed connection options 2017-11-30 10:34:56 +01:00
simonxca
bf99493e11 Allow overriding id attribute 2017-11-29 22:13:11 -08:00
simonxca
7c0a078ce9 Remove type parameter and use object type 2017-11-22 19:41:51 -08:00
simonxca
13d444d6d1 Add generic type for lean method
Fixes #20874
2017-11-16 11:22:14 -08:00
simonxca
2a5a4ff2fd Add tests for mongoose child schema
Fixes #20331
2017-11-13 21:06:55 -08:00
Nathan Shively-Sanders
ff929fcd51
Merge pull request #21314 from Joge97/master
[mongoose] Fix types for SchemaDefinition
2017-11-13 15:33:07 -08:00
Joge
18ad4aba5a fix(Tests): fix implicit any error 2017-11-07 15:04:43 +01:00
Joge
d8914103a3 fix(SchemaDefinition): add missing Schema and SchemaType declarations 2017-11-07 13:46:50 +01:00
Gregor Yushinov
01be23749e One can set connection options on the object's root level now
All options which usually have been passed in the db/auth/server/replset object can now be set directly in the connection options. If you don't do so you get hints in the debug console. For reference see: https://github.com/Automattic/mongoose/blob/master/lib/drivers/node-mongodb-native/connection.js#L272
2017-11-05 02:49:22 +01:00
Daniel Hritzkiv
4e278d0f6d
SchemaOptions.safe can also be an object
See: [safe docs](http://mongoosejs.com/docs/guide.html#safe)
2017-11-01 11:44:25 -04:00
Andy
19f89399e4 Ensure every package has a tslint.json (#21009)
* Ensure every package has a tslint.json

* Fixes
2017-10-25 11:13:50 -07:00
Weeco
0cbf897a5d Added eachAsync options for concurrency (#20541)
* Added eachAsync options for concurrency

* Added overload function definition for eachAsync
2017-10-19 07:39:30 -07:00
Andy
947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Kanibal
e30f58fda5 done-callback supports a optional error parameter 2017-09-22 02:55:02 +02:00
Benjamin Lichtman
dc587128da Merge pull request #19944 from wy193777/master
[mongoose] fix some missing semicolon
2017-09-21 16:06:32 -07:00
Shenghan Gao
ca30f9b4fa fix some missing semicolon 2017-09-21 11:39:14 -07:00
Khalid Saifullah
e06a7cc6e4 Missing options for ModelFindByIdAndUpdateOptions
@see http://mongoosejs.com/docs/api.html#model_Model.findByIdAndUpdate
2017-09-20 20:20:11 +10:00
Andy
924fafffc0 Fix remaining lint errors (#19166) 2017-08-20 15:37:53 -07:00
Andy Hanson
c601b75e4b mongoose: Fix compile errors 2017-08-17 14:37:49 -07:00
Roman Jurkov
c2ca879dca changed capped property in SchemaOptions to match mongoose 4 document… (#18901)
* changed capped property in SchemaOptions to match mongoose 4 documentation http://mongoosejs.com/docs/guide.html#capped

* added boolean type as an option to capped
2017-08-14 11:17:04 -07:00
Andy
af8b0d1294 FIx new lint errors (#18382) 2017-07-25 10:34:23 -07:00
Lukasz Zak
a3819eec07 [mongoose] Add missing property for >=4.1.1 version
DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use
`openUri()` instead, or set the `useMongoClient` option if using
`connect()` or `createConnection()`. See
http://mongoosejs.com/docs/connections.html#use-mongo-client
2017-07-18 13:04:48 +02:00
SkyAo
6711c77b2f [mongoose] add useMongoClient in ConnectOpenOptionsBase Interface 2017-06-26 18:22:52 +08:00
steven
d534d3a622 Add callback param to Model's findOneAndUpdate method 2017-06-16 15:50:07 -07:00
steven
4de9f521d9 findOneAndUpdate: Add new parameter to callback 2017-06-16 10:54:05 -07:00
Yui
4ec4088feb Merge pull request #17019 from nicolashenry/mongoose
[mongoose] set strictNullChecks to true
2017-06-07 16:33:08 -07:00
Federico Caselli
7fc1644080 [mongodb] Added support for default generic types (#16198)
* Added support for ts2.3 default generic types

* Updated find and findOne

* Capitalized TypeScript Version

* Added missing TypeScript Version: 2.3

* Added TypeScript Version: 2.3 to express-brute-mongo; removed easy-jsend test dependency on mongoose
2017-06-07 10:41:33 -07:00
E020873
62c91567aa [mongoose] set strictNullChecks to true 2017-06-07 14:04:49 +02:00
Nathan Shively-Sanders
163f4438df Fix weak type errors (#16845)
* Fix first round of weak type errors

Done through griddle-react

* 95% done with weak type fixes

* Fix last couple of weak type errors

* Remove some lint from mithril tests

* mithril's Lifecycle is not a weak type any more

Restore the Lifecycle constraints in the rest of the definitions.

* Fix react-redux tests after #16652 broke them

* Remove package-lock.json
2017-06-04 22:03:03 -07:00
Simon Xiong
c85fe6ae3f Add new collation methods for mongoose (#16897)
* Add collation methods for query and aggregation

* Add tests for collation
2017-06-01 10:22:14 -07:00
Dani Gámez Franco
d7ea6529f6 Add discriminatorKey to SchemaOptions interface. 2017-05-18 03:56:44 +02:00
Andrii Nasinnyk
e377be5ad1 made pathsToValidate in mongoose::validateSync optional 2017-05-11 14:25:47 +03:00
Ryan Cavanaugh
082f61c87f Merge pull request #15719 from fabiob/mongoose-save-options
@types/mongoose: added save options
2017-04-17 18:08:44 -07:00
Fábio Batista
ac1a97d16b @types/mongoose: changed save overloads order 2017-04-17 15:21:23 -03:00
Ryan Cavanaugh
10cf902414 Merge pull request #15718 from fabiob/mongoose-docs-fix
@types/mongoose: better docs
2017-04-17 11:06:09 -07:00
Fábio Batista
f44a1808a5 @types/mongoose: testing type inference on callbacks 2017-04-07 22:57:08 -03:00