mongoose 9.2.3 → 9.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/lib/aggregate.js +41 -41
  2. package/lib/cast/bigint.js +2 -2
  3. package/lib/cast/boolean.js +3 -3
  4. package/lib/cast/double.js +2 -2
  5. package/lib/cast/int32.js +2 -2
  6. package/lib/cast/number.js +2 -2
  7. package/lib/cast/string.js +2 -2
  8. package/lib/cast.js +6 -6
  9. package/lib/collection.js +4 -4
  10. package/lib/connection.js +58 -58
  11. package/lib/cursor/aggregationCursor.js +6 -6
  12. package/lib/cursor/queryCursor.js +7 -7
  13. package/lib/document.js +176 -176
  14. package/lib/drivers/node-mongodb-native/collection.js +2 -2
  15. package/lib/drivers/node-mongodb-native/connection.js +8 -8
  16. package/lib/error/cast.js +2 -2
  17. package/lib/error/createCollectionsError.js +2 -2
  18. package/lib/error/divergentArray.js +1 -1
  19. package/lib/error/eachAsyncMultiError.js +1 -1
  20. package/lib/error/index.js +2 -2
  21. package/lib/error/invalidSchemaOption.js +1 -1
  22. package/lib/error/missingSchema.js +1 -1
  23. package/lib/error/objectParameter.js +3 -3
  24. package/lib/error/overwriteModel.js +1 -1
  25. package/lib/error/setOptionError.js +3 -3
  26. package/lib/error/strict.js +3 -3
  27. package/lib/error/strictPopulate.js +2 -2
  28. package/lib/error/syncIndexes.js +2 -2
  29. package/lib/error/validation.js +2 -2
  30. package/lib/error/validator.js +1 -1
  31. package/lib/error/version.js +2 -2
  32. package/lib/helpers/buildMiddlewareFilter.js +2 -2
  33. package/lib/helpers/clone.js +4 -4
  34. package/lib/helpers/createJSONSchemaTypeDefinition.js +4 -4
  35. package/lib/helpers/cursor/eachAsync.js +3 -3
  36. package/lib/helpers/discriminator/getDiscriminatorByValue.js +1 -1
  37. package/lib/helpers/discriminator/mergeDiscriminatorSchema.js +3 -3
  38. package/lib/helpers/document/applyTimestamps.js +9 -9
  39. package/lib/helpers/document/applyVirtuals.js +6 -6
  40. package/lib/helpers/document/compile.js +10 -10
  41. package/lib/helpers/document/getDeepestSubdocumentForPath.js +2 -2
  42. package/lib/helpers/document/getEmbeddedDiscriminatorPath.js +2 -2
  43. package/lib/helpers/indexes/isIndexEqual.js +3 -3
  44. package/lib/helpers/indexes/isIndexSpecEqual.js +3 -3
  45. package/lib/helpers/isMongooseObject.js +1 -1
  46. package/lib/helpers/isObject.js +2 -2
  47. package/lib/helpers/isSimpleValidator.js +2 -2
  48. package/lib/helpers/minimize.js +2 -2
  49. package/lib/helpers/model/applyHooks.js +1 -1
  50. package/lib/helpers/model/castBulkWrite.js +2 -2
  51. package/lib/helpers/pluralize.js +1 -1
  52. package/lib/helpers/populate/assignRawDocsToIdStructure.js +2 -2
  53. package/lib/helpers/populate/assignVals.js +6 -6
  54. package/lib/helpers/populate/createPopulateQueryFilter.js +2 -2
  55. package/lib/helpers/populate/getModelsMapForPopulate.js +12 -12
  56. package/lib/helpers/populate/getSchemaTypes.js +1 -1
  57. package/lib/helpers/populate/markArraySubdocsPopulated.js +1 -1
  58. package/lib/helpers/populate/setPopulatedVirtualValue.js +5 -5
  59. package/lib/helpers/projection/hasIncludedChildren.js +1 -1
  60. package/lib/helpers/projection/isPathExcluded.js +3 -3
  61. package/lib/helpers/projection/isSubpath.js +1 -1
  62. package/lib/helpers/query/castUpdate.js +14 -14
  63. package/lib/helpers/query/getEmbeddedDiscriminatorPath.js +4 -4
  64. package/lib/helpers/query/handleImmutable.js +6 -6
  65. package/lib/helpers/schema/getIndexes.js +1 -1
  66. package/lib/helpers/schema/getSubdocumentStrictValue.js +1 -1
  67. package/lib/helpers/setDefaultsOnInsert.js +3 -3
  68. package/lib/helpers/update/modifiedPaths.js +2 -2
  69. package/lib/helpers/updateValidators.js +2 -2
  70. package/lib/model.js +263 -263
  71. package/lib/mongoose.js +54 -54
  72. package/lib/options/schemaArrayOptions.js +2 -2
  73. package/lib/options/schemaBufferOptions.js +1 -1
  74. package/lib/options/schemaNumberOptions.js +3 -3
  75. package/lib/options/schemaObjectIdOptions.js +2 -2
  76. package/lib/options/schemaStringOptions.js +6 -6
  77. package/lib/options/schemaTypeOptions.js +13 -13
  78. package/lib/options/virtualOptions.js +11 -11
  79. package/lib/query.js +222 -222
  80. package/lib/queryHelpers.js +4 -4
  81. package/lib/schema/array.js +18 -18
  82. package/lib/schema/bigint.js +13 -13
  83. package/lib/schema/boolean.js +13 -13
  84. package/lib/schema/buffer.js +14 -14
  85. package/lib/schema/date.js +16 -16
  86. package/lib/schema/decimal128.js +13 -13
  87. package/lib/schema/documentArray.js +15 -15
  88. package/lib/schema/documentArrayElement.js +5 -6
  89. package/lib/schema/double.js +12 -12
  90. package/lib/schema/int32.js +13 -13
  91. package/lib/schema/map.js +10 -10
  92. package/lib/schema/mixed.js +10 -10
  93. package/lib/schema/number.js +18 -18
  94. package/lib/schema/objectId.js +14 -14
  95. package/lib/schema/operators/text.js +3 -3
  96. package/lib/schema/string.js +17 -17
  97. package/lib/schema/subdocument.js +13 -13
  98. package/lib/schema/union.js +3 -3
  99. package/lib/schema/uuid.js +16 -16
  100. package/lib/schema.js +76 -76
  101. package/lib/schemaType.js +62 -62
  102. package/lib/stateMachine.js +5 -8
  103. package/lib/types/array/index.js +1 -1
  104. package/lib/types/array/methods/index.js +12 -12
  105. package/lib/types/arraySubdocument.js +8 -8
  106. package/lib/types/buffer.js +4 -4
  107. package/lib/types/documentArray/index.js +1 -1
  108. package/lib/types/documentArray/methods/index.js +5 -5
  109. package/lib/types/map.js +3 -3
  110. package/lib/types/subdocument.js +11 -11
  111. package/lib/utils.js +45 -45
  112. package/lib/virtualType.js +18 -18
  113. package/package.json +8 -5
  114. package/types/index.d.ts +16 -15
  115. package/types/inferschematype.d.ts +10 -0
  116. package/types/models.d.ts +7 -4
  117. package/types/schemaoptions.d.ts +1 -1
  118. package/types/virtuals.d.ts +10 -10
package/lib/aggregate.js CHANGED
@@ -159,7 +159,7 @@ Aggregate.prototype.model = function(model) {
159
159
  * const pipeline = [{ $match: { daw: 'Logic Audio X' }} ];
160
160
  * aggregate.append(pipeline);
161
161
  *
162
- * @param {...Object|Object[]} ops operator(s) to append. Can either be a spread of objects or a single parameter of a object array.
162
+ * @param {...object|object[]} ops operator(s) to append. Can either be a spread of objects or a single parameter of a object array.
163
163
  * @return {Aggregate}
164
164
  * @api public
165
165
  */
@@ -196,7 +196,7 @@ Aggregate.prototype.append = function() {
196
196
  * // etc
197
197
  * aggregate.addFields({ salary_k: { $divide: [ "$salary", 1000 ] } });
198
198
  *
199
- * @param {Object} arg field specification
199
+ * @param {object} arg field specification
200
200
  * @see $addFields https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/
201
201
  * @return {Aggregate}
202
202
  * @api public
@@ -234,7 +234,7 @@ Aggregate.prototype.addFields = function(arg) {
234
234
  * // etc
235
235
  * aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ] } });
236
236
  *
237
- * @param {Object|String} arg field specification
237
+ * @param {object|string} arg field specification
238
238
  * @see projection https://www.mongodb.com/docs/manual/reference/aggregation/project/
239
239
  * @return {Aggregate}
240
240
  * @api public
@@ -276,7 +276,7 @@ Aggregate.prototype.project = function(arg) {
276
276
  * @method group
277
277
  * @memberOf Aggregate
278
278
  * @instance
279
- * @param {Object} arg $group operator contents
279
+ * @param {object} arg $group operator contents
280
280
  * @return {Aggregate}
281
281
  * @api public
282
282
  */
@@ -292,7 +292,7 @@ Aggregate.prototype.project = function(arg) {
292
292
  * @method match
293
293
  * @memberOf Aggregate
294
294
  * @instance
295
- * @param {Object} arg $match operator contents
295
+ * @param {object} arg $match operator contents
296
296
  * @return {Aggregate}
297
297
  * @api public
298
298
  */
@@ -308,7 +308,7 @@ Aggregate.prototype.project = function(arg) {
308
308
  * @method skip
309
309
  * @memberOf Aggregate
310
310
  * @instance
311
- * @param {Number} num number of records to skip before next stage
311
+ * @param {number} num number of records to skip before next stage
312
312
  * @return {Aggregate}
313
313
  * @api public
314
314
  */
@@ -324,7 +324,7 @@ Aggregate.prototype.project = function(arg) {
324
324
  * @method limit
325
325
  * @memberOf Aggregate
326
326
  * @instance
327
- * @param {Number} num maximum number of records to pass to the next stage
327
+ * @param {number} num maximum number of records to pass to the next stage
328
328
  * @return {Aggregate}
329
329
  * @api public
330
330
  */
@@ -348,7 +348,7 @@ Aggregate.prototype.project = function(arg) {
348
348
  * @method densify
349
349
  * @memberOf Aggregate
350
350
  * @instance
351
- * @param {Object} arg $densify operator contents
351
+ * @param {object} arg $densify operator contents
352
352
  * @return {Aggregate}
353
353
  * @api public
354
354
  */
@@ -370,7 +370,7 @@ Aggregate.prototype.project = function(arg) {
370
370
  * @method fill
371
371
  * @memberOf Aggregate
372
372
  * @instance
373
- * @param {Object} arg $fill operator contents
373
+ * @param {object} arg $fill operator contents
374
374
  * @return {Aggregate}
375
375
  * @api public
376
376
  */
@@ -397,8 +397,8 @@ Aggregate.prototype.project = function(arg) {
397
397
  * @method near
398
398
  * @memberOf Aggregate
399
399
  * @instance
400
- * @param {Object} arg
401
- * @param {Object|Array<Number>} arg.near GeoJSON point or coordinates array
400
+ * @param {object} arg
401
+ * @param {object|number[]} arg.near GeoJSON point or coordinates array
402
402
  * @return {Aggregate}
403
403
  * @api public
404
404
  */
@@ -445,7 +445,7 @@ Aggregate.prototype.near = function(arg) {
445
445
  * aggregate.unwind({ path: '$tags', preserveNullAndEmptyArrays: true });
446
446
  *
447
447
  * @see $unwind https://www.mongodb.com/docs/manual/reference/aggregation/unwind/
448
- * @param {String|Object|String[]|Object[]} fields the field(s) to unwind, either as field names or as [objects with options](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/#document-operand-with-options). If passing a string, prefixing the field name with '$' is optional. If passing an object, `path` must start with '$'.
448
+ * @param {string|object|string[]|object[]} fields the field(s) to unwind, either as field names or as [objects with options](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/#document-operand-with-options). If passing a string, prefixing the field name with '$' is optional. If passing an object, `path` must start with '$'.
449
449
  * @return {Aggregate}
450
450
  * @api public
451
451
  */
@@ -484,7 +484,7 @@ Aggregate.prototype.unwind = function() {
484
484
  * aggregate.replaceRoot({ x: { $concat: ['$this', '$that'] } });
485
485
  *
486
486
  * @see $replaceRoot https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceRoot
487
- * @param {String|Object} newRoot the field or document which will become the new root document
487
+ * @param {string|object} newRoot the field or document which will become the new root document
488
488
  * @return {Aggregate}
489
489
  * @api public
490
490
  */
@@ -513,7 +513,7 @@ Aggregate.prototype.replaceRoot = function(newRoot) {
513
513
  * aggregate.count("userCount");
514
514
  *
515
515
  * @see $count https://www.mongodb.com/docs/manual/reference/operator/aggregation/count
516
- * @param {String} fieldName The name of the output field which has the count as its value. It must be a non-empty string, must not start with $ and must not contain the . character.
516
+ * @param {string} fieldName The name of the output field which has the count as its value. It must be a non-empty string, must not start with $ and must not contain the . character.
517
517
  * @return {Aggregate}
518
518
  * @api public
519
519
  */
@@ -535,7 +535,7 @@ Aggregate.prototype.count = function(fieldName) {
535
535
  * aggregate.sortByCount({ $mergeObjects: [ "$employee", "$business" ] })
536
536
  *
537
537
  * @see $sortByCount https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortByCount/
538
- * @param {Object|String} arg
538
+ * @param {object|string} arg
539
539
  * @return {Aggregate} this
540
540
  * @api public
541
541
  */
@@ -561,7 +561,7 @@ Aggregate.prototype.sortByCount = function(arg) {
561
561
  * aggregate.lookup({ from: 'users', localField: 'userId', foreignField: '_id', as: 'users' });
562
562
  *
563
563
  * @see $lookup https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/#pipe._S_lookup
564
- * @param {Object} options to $lookup as described in the above link
564
+ * @param {object} options to $lookup as described in the above link
565
565
  * @return {Aggregate}
566
566
  * @api public
567
567
  */
@@ -581,7 +581,7 @@ Aggregate.prototype.lookup = function(options) {
581
581
  * aggregate.graphLookup({ from: 'courses', startWith: '$prerequisite', connectFromField: 'prerequisite', connectToField: 'name', as: 'prerequisites', maxDepth: 3 }) // this will recursively search the 'courses' collection up to 3 prerequisites
582
582
  *
583
583
  * @see $graphLookup https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/#pipe._S_graphLookup
584
- * @param {Object} options to $graphLookup as described in the above link
584
+ * @param {object} options to $graphLookup as described in the above link
585
585
  * @return {Aggregate}
586
586
  * @api public
587
587
  */
@@ -614,7 +614,7 @@ Aggregate.prototype.graphLookup = function(options) {
614
614
  * aggregate.sample(3); // Add a pipeline that picks 3 random documents
615
615
  *
616
616
  * @see $sample https://www.mongodb.com/docs/manual/reference/operator/aggregation/sample/#pipe._S_sample
617
- * @param {Number} size number of random documents to pick
617
+ * @param {number} size number of random documents to pick
618
618
  * @return {Aggregate}
619
619
  * @api public
620
620
  */
@@ -637,7 +637,7 @@ Aggregate.prototype.sample = function(size) {
637
637
  * aggregate.sort('field -test');
638
638
  *
639
639
  * @see $sort https://www.mongodb.com/docs/manual/reference/aggregation/sort/
640
- * @param {Object|String} arg
640
+ * @param {object|string} arg
641
641
  * @return {Aggregate} this
642
642
  * @api public
643
643
  */
@@ -683,7 +683,7 @@ Aggregate.prototype.sort = function(arg) {
683
683
  * aggregate.unionWith({ coll: 'users', pipeline: [ { $match: { _id: 1 } } ] });
684
684
  *
685
685
  * @see $unionWith https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith
686
- * @param {Object} options to $unionWith query as described in the above link
686
+ * @param {object} options to $unionWith query as described in the above link
687
687
  * @return {Aggregate}
688
688
  * @api public
689
689
  */
@@ -700,7 +700,7 @@ Aggregate.prototype.unionWith = function(options) {
700
700
  *
701
701
  * await Model.aggregate(pipeline).read('primaryPreferred');
702
702
  *
703
- * @param {String|ReadPreference} pref one of the listed preference options or their aliases
703
+ * @param {string|ReadPreference} pref one of the listed preference options or their aliases
704
704
  * @param {Array} [tags] optional tags for this query.
705
705
  * @return {Aggregate} this
706
706
  * @api public
@@ -749,9 +749,9 @@ Aggregate.prototype.readConcern = function(level) {
749
749
  * // $redact often comes with $cond operator, you can also use the following syntax provided by mongoose
750
750
  * await Model.aggregate(pipeline).redact({ $eq: [ '$level', 5 ] }, '$$PRUNE', '$$DESCEND');
751
751
  *
752
- * @param {Object} expression redact options or conditional expression
753
- * @param {String|Object} [thenExpr] true case for the condition
754
- * @param {String|Object} [elseExpr] false case for the condition
752
+ * @param {object} expression redact options or conditional expression
753
+ * @param {string|object} [thenExpr] true case for the condition
754
+ * @param {string|object} [elseExpr] false case for the condition
755
755
  * @return {Aggregate} this
756
756
  * @see $redact https://www.mongodb.com/docs/manual/reference/operator/aggregation/redact/
757
757
  * @api public
@@ -839,7 +839,7 @@ Aggregate.prototype.explain = async function explain(verbosity) {
839
839
  *
840
840
  * await Model.aggregate([{ $match: { foo: 'bar' } }]).allowDiskUse(true);
841
841
  *
842
- * @param {Boolean} value Should tell server it can use hard drive to store data during aggregation.
842
+ * @param {boolean} value Should tell server it can use hard drive to store data during aggregation.
843
843
  * @return {Aggregate} this
844
844
  * @see mongodb https://www.mongodb.com/docs/manual/reference/command/aggregate/
845
845
  */
@@ -856,7 +856,7 @@ Aggregate.prototype.allowDiskUse = function(value) {
856
856
  *
857
857
  * Model.aggregate(..).hint({ qty: 1, category: 1 }).exec();
858
858
  *
859
- * @param {Object|String} value a hint object or the index name
859
+ * @param {object|string} value a hint object or the index name
860
860
  * @return {Aggregate} this
861
861
  * @see mongodb https://www.mongodb.com/docs/manual/reference/command/aggregate/
862
862
  */
@@ -896,14 +896,14 @@ Aggregate.prototype.session = function(session) {
896
896
  * const agg = Model.aggregate(..).option({ allowDiskUse: true }); // Set the `allowDiskUse` option
897
897
  * agg.options; // `{ allowDiskUse: true }`
898
898
  *
899
- * @param {Object} options keys to merge into current options
900
- * @param {Number} [options.maxTimeMS] number limits the time this aggregation will run, see [MongoDB docs on `maxTimeMS`](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/)
901
- * @param {Boolean} [options.allowDiskUse] boolean if true, the MongoDB server will use the hard drive to store data during this aggregation
902
- * @param {Object} [options.collation] object see [`Aggregate.prototype.collation()`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.collation())
899
+ * @param {object} options keys to merge into current options
900
+ * @param {number} [options.maxTimeMS] number limits the time this aggregation will run, see [MongoDB docs on `maxTimeMS`](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/)
901
+ * @param {boolean} [options.allowDiskUse] boolean if true, the MongoDB server will use the hard drive to store data during this aggregation
902
+ * @param {object} [options.collation] object see [`Aggregate.prototype.collation()`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.collation())
903
903
  * @param {ClientSession} [options.session] ClientSession see [`Aggregate.prototype.session()`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.session())
904
- * @param {Boolean|Object} [options.middleware=true] set to `false` to skip all user-defined middleware
905
- * @param {Boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks
906
- * @param {Boolean} [options.middleware.post=true] set to `false` to skip only post hooks
904
+ * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware
905
+ * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks
906
+ * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks
907
907
  * @see mongodb https://www.mongodb.com/docs/manual/reference/command/aggregate/
908
908
  * @return {Aggregate} this
909
909
  * @api public
@@ -928,9 +928,9 @@ Aggregate.prototype.option = function(value) {
928
928
  * // use doc
929
929
  * });
930
930
  *
931
- * @param {Object} options
932
- * @param {Number} [options.batchSize] set the cursor batch size
933
- * @param {Boolean} [options.useMongooseAggCursor] use experimental mongoose-specific aggregation cursor (for `eachAsync()` and other query cursor semantics)
931
+ * @param {object} options
932
+ * @param {number} [options.batchSize] set the cursor batch size
933
+ * @param {boolean} [options.useMongooseAggCursor] use experimental mongoose-specific aggregation cursor (for `eachAsync()` and other query cursor semantics)
934
934
  * @return {AggregationCursor} cursor representing this aggregation
935
935
  * @api public
936
936
  * @see mongodb https://mongodb.github.io/node-mongodb-native/4.9/classes/AggregationCursor.html
@@ -949,7 +949,7 @@ Aggregate.prototype.cursor = function(options) {
949
949
  *
950
950
  * const res = await Model.aggregate(pipeline).collation({ locale: 'en_US', strength: 1 });
951
951
  *
952
- * @param {Object} collation options
952
+ * @param {object} collation options
953
953
  * @return {Aggregate} this
954
954
  * @api public
955
955
  * @see mongodb https://mongodb.github.io/node-mongodb-native/4.9/interfaces/CollationOptions.html
@@ -972,7 +972,7 @@ Aggregate.prototype.collation = function(collation) {
972
972
  *
973
973
  * // Output: { books: [...], price: [{...}, {...}] }
974
974
  *
975
- * @param {Object} facet options
975
+ * @param {object} facet options
976
976
  * @return {Aggregate} this
977
977
  * @see $facet https://www.mongodb.com/docs/manual/reference/operator/aggregation/facet/
978
978
  * @api public
@@ -998,7 +998,7 @@ Aggregate.prototype.facet = function(options) {
998
998
  *
999
999
  * // Output: [{ plot: '...', title: '...' }]
1000
1000
  *
1001
- * @param {Object} $search options
1001
+ * @param {object} $search options
1002
1002
  * @return {Aggregate} this
1003
1003
  * @see $search https://www.mongodb.com/docs/atlas/atlas-search/tutorial/
1004
1004
  * @api public
@@ -1170,8 +1170,8 @@ Aggregate.prototype[Symbol.asyncIterator] = function() {
1170
1170
  /**
1171
1171
  * Checks whether an object is likely a pipeline operator
1172
1172
  *
1173
- * @param {Object} obj object to check
1174
- * @return {Boolean}
1173
+ * @param {object} obj object to check
1174
+ * @return {boolean}
1175
1175
  * @api private
1176
1176
  */
1177
1177
 
@@ -6,8 +6,8 @@ const { Long } = require('mongodb/lib/bson');
6
6
  * Given a value, cast it to a BigInt, or throw an `Error` if the value
7
7
  * cannot be casted. `null` and `undefined` are considered valid.
8
8
  *
9
- * @param {Any} value
10
- * @return {Number}
9
+ * @param {any} value
10
+ * @return {bigint|null|undefined}
11
11
  * @throws {Error} if `value` is not one of the allowed values
12
12
  * @api private
13
13
  */
@@ -6,9 +6,9 @@ const CastError = require('../error/cast');
6
6
  * Given a value, cast it to a boolean, or throw a `CastError` if the value
7
7
  * cannot be casted. `null` and `undefined` are considered valid.
8
8
  *
9
- * @param {Any} value
10
- * @param {String} [path] optional the path to set on the CastError
11
- * @return {Boolean|null|undefined}
9
+ * @param {any} value
10
+ * @param {string} [path] optional the path to set on the CastError
11
+ * @return {boolean|null|undefined}
12
12
  * @throws {CastError} if `value` is not one of the allowed values
13
13
  * @api private
14
14
  */
@@ -8,8 +8,8 @@ const isBsonType = require('../helpers/isBsonType');
8
8
  * Given a value, cast it to a IEEE 754-2008 floating point, or throw an `Error` if the value
9
9
  * cannot be casted. `null`, `undefined`, and `NaN` are considered valid inputs.
10
10
  *
11
- * @param {Any} value
12
- * @return {Number}
11
+ * @param {any} value
12
+ * @return {number}
13
13
  * @throws {Error} if `value` does not represent a IEEE 754-2008 floating point. If casting from a string, see [BSON Double.fromString API documentation](https://mongodb.github.io/node-mongodb-native/Next/classes/BSON.Double.html#fromString)
14
14
  * @api private
15
15
  */
package/lib/cast/int32.js CHANGED
@@ -7,8 +7,8 @@ const assert = require('assert');
7
7
  * Given a value, cast it to a Int32, or throw an `Error` if the value
8
8
  * cannot be casted. `null` and `undefined` are considered valid.
9
9
  *
10
- * @param {Any} value
11
- * @return {Number}
10
+ * @param {any} value
11
+ * @return {number}
12
12
  * @throws {Error} if `value` does not represent an integer, or is outside the bounds of an 32-bit integer.
13
13
  * @api private
14
14
  */
@@ -6,8 +6,8 @@ const assert = require('assert');
6
6
  * Given a value, cast it to a number, or throw an `Error` if the value
7
7
  * cannot be casted. `null` and `undefined` are considered valid.
8
8
  *
9
- * @param {Any} value
10
- * @return {Number}
9
+ * @param {any} value
10
+ * @return {number}
11
11
  * @throws {Error} if `value` is not one of the allowed values
12
12
  * @api private
13
13
  */
@@ -6,8 +6,8 @@ const CastError = require('../error/cast');
6
6
  * Given a value, cast it to a string, or throw a `CastError` if the value
7
7
  * cannot be casted. `null` and `undefined` are considered valid.
8
8
  *
9
- * @param {Any} value
10
- * @param {String} [path] optional the path to set on the CastError
9
+ * @param {any} value
10
+ * @param {string} [path] optional the path to set on the CastError
11
11
  * @return {string|null|undefined}
12
12
  * @throws {CastError}
13
13
  * @api private
package/lib/cast.js CHANGED
@@ -24,12 +24,12 @@ const ALLOWED_GEOWITHIN_GEOJSON_TYPES = ['Polygon', 'MultiPolygon'];
24
24
  * Handles internal casting for query filters.
25
25
  *
26
26
  * @param {Schema} schema
27
- * @param {Object} obj Object to cast
28
- * @param {Object} [options] the query options
29
- * @param {Boolean|"throw"} [options.strict] Wheter to enable all strict options
30
- * @param {Boolean|"throw"} [options.strictQuery] Enable strict Queries
31
- * @param {Boolean} [options.sanitizeFilter] avoid adding implict query selectors ($in)
32
- * @param {Boolean} [options.upsert]
27
+ * @param {object} obj Object to cast
28
+ * @param {object} [options] the query options
29
+ * @param {boolean|"throw"} [options.strict] Whether to enable all strict options
30
+ * @param {boolean|"throw"} [options.strictQuery] Enable strict Queries
31
+ * @param {boolean} [options.sanitizeFilter] avoid adding implicit query selectors ($in)
32
+ * @param {boolean} [options.upsert]
33
33
  * @param {Query} [context] passed to setters
34
34
  * @api private
35
35
  */
package/lib/collection.js CHANGED
@@ -13,9 +13,9 @@ const immediate = require('./helpers/immediate');
13
13
  *
14
14
  * This is the base class that drivers inherit from and implement.
15
15
  *
16
- * @param {String} name name of the collection
16
+ * @param {string} name name of the collection
17
17
  * @param {Connection} conn A MongooseConnection instance
18
- * @param {Object} [opts] optional collection options
18
+ * @param {object} [opts] optional collection options
19
19
  * @api public
20
20
  */
21
21
 
@@ -87,7 +87,7 @@ Collection.prototype.onClose = function() {};
87
87
  * Queues a method for later execution when its
88
88
  * database connection opens.
89
89
  *
90
- * @param {String} name name of the method to queue
90
+ * @param {string} name name of the method to queue
91
91
  * @param {Array} args arguments to pass to the method when executed
92
92
  * @api private
93
93
  */
@@ -100,7 +100,7 @@ Collection.prototype.addQueue = function(name, args) {
100
100
  /**
101
101
  * Removes a queued method
102
102
  *
103
- * @param {String} name name of the method to queue
103
+ * @param {string} name name of the method to queue
104
104
  * @param {Array} args arguments to pass to the method when executed
105
105
  * @api private
106
106
  */