Skip to content

Commit 14fd916

Browse files
committed
docs: clean up some API issues re: #12024
1 parent d80a2ee commit 14fd916

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

lib/document.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,7 @@ Document.prototype.$isDeleted = function(val) {
21672167
* doc.isDirectModified('documents.0.title') // true
21682168
* doc.isDirectModified('documents') // false
21692169
*
2170-
* @param {String|Array<String>} path
2170+
* @param {String|String[]} path
21712171
* @return {Boolean}
21722172
* @api public
21732173
*/
@@ -2223,7 +2223,7 @@ Document.prototype.isInit = function(path) {
22232223
* doc.isSelected('name') // true
22242224
* doc.isSelected('age') // false
22252225
*
2226-
* @param {String|Array<String>} path
2226+
* @param {String|String[]} path
22272227
* @return {Boolean}
22282228
* @api public
22292229
*/
@@ -3110,7 +3110,7 @@ function _checkImmutableSubpaths(subdoc, schematype, priorVal) {
31103110
/**
31113111
* Checks if a path is invalid
31123112
*
3113-
* @param {String|Array<String>} path the field to check
3113+
* @param {String|String[]} path the field to check
31143114
* @method $isValid
31153115
* @memberOf Document
31163116
* @instance
@@ -4342,7 +4342,7 @@ Document.prototype.$populated = Document.prototype.populated;
43424342
* doc.$assertPopulated('other path'); // throws an error
43434343
*
43444344
*
4345-
* @param {String|Array<String>} path
4345+
* @param {String|String[]} path
43464346
* @return {Document} this
43474347
* @memberOf Document
43484348
* @method $assertPopulated

lib/model.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ Model.deleteMany = function deleteMany(conditions, options, callback) {
21292129
* await MyModel.find({ name: /john/i }, null, { skip: 10 }).exec();
21302130
*
21312131
* @param {Object|ObjectId} filter
2132-
* @param {Object|String|Array<String>} [projection] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api.html#query_Query-select)
2132+
* @param {Object|String|String[]} [projection] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api.html#query_Query-select)
21332133
* @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions)
21342134
* @param {Function} [callback]
21352135
* @return {Query}
@@ -2192,7 +2192,7 @@ Model.find = function find(conditions, projection, options, callback) {
21922192
* await Adventure.findById(id, 'name length').exec();
21932193
*
21942194
* @param {Any} id value of `_id` to query by
2195-
* @param {Object|String|Array<String>} [projection] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2195+
* @param {Object|String|String[]} [projection] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
21962196
* @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions)
21972197
* @param {Function} [callback]
21982198
* @return {Query}
@@ -2235,7 +2235,7 @@ Model.findById = function findById(id, projection, options, callback) {
22352235
* await Adventure.findOne({ country: 'Croatia' }, 'name length').exec();
22362236
*
22372237
* @param {Object} [conditions]
2238-
* @param {Object|String|Array<String>} [projection] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2238+
* @param {Object|String|String[]} [projection] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
22392239
* @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions)
22402240
* @param {Function} [callback]
22412241
* @return {Query}
@@ -2533,7 +2533,7 @@ Model.$where = function $where() {
25332533
* @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set.
25342534
* @param {Boolean} [options.overwrite=false] By default, if you don't include any [update operators](https://docs.mongodb.com/manual/reference/operator/update/) in `update`, Mongoose will wrap `update` in `$set` for you. This prevents you from accidentally overwriting the document. This option tells Mongoose to skip adding `$set`. An alternative to this would be using [Model.findOneAndReplace(conditions, update, options, callback)](https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndReplace).
25352535
* @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document
2536-
* @param {Object|String|Array<String>} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2536+
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
25372537
* @param {Function} [callback]
25382538
* @return {Query}
25392539
* @see Tutorial /docs/tutorials/findoneandupdate.html
@@ -2749,7 +2749,7 @@ Model.findByIdAndUpdate = function(id, update, options, callback) {
27492749
* @param {Object} conditions
27502750
* @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions)
27512751
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
2752-
* @param {Object|String|Array<String>} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2752+
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
27532753
* @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html).
27542754
* @param {Function} [callback]
27552755
* @return {Query}
@@ -2855,7 +2855,7 @@ Model.findByIdAndDelete = function(id, options, callback) {
28552855
* @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html).
28562856
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
28572857
* @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set.
2858-
* @param {Object|String|Array<String>} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2858+
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
28592859
* @param {Function} [callback]
28602860
* @return {Query}
28612861
* @api public
@@ -2942,7 +2942,7 @@ Model.findOneAndReplace = function(filter, replacement, options, callback) {
29422942
* @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions)
29432943
* @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html).
29442944
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
2945-
* @param {Object|String|Array<String>} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2945+
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
29462946
* @param {Function} [callback]
29472947
* @return {Query}
29482948
* @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command
@@ -3008,7 +3008,7 @@ Model.findOneAndRemove = function(conditions, options, callback) {
30083008
* @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions)
30093009
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
30103010
* @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html).
3011-
* @param {Object|String|Array<String>} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
3011+
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
30123012
* @param {Function} [callback]
30133013
* @return {Query}
30143014
* @see Model.findOneAndRemove #model_Model.findOneAndRemove
@@ -3288,11 +3288,11 @@ Model.startSession = function() {
32883288
*
32893289
* @param {Array|Object|*} doc(s)
32903290
* @param {Object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#insertMany)
3291-
* @param {Boolean} [options.ordered = true] if true, will fail fast on the first error encountered. If false, will insert all the documents it can and report errors later. An `insertMany()` with `ordered = false` is called an "unordered" `insertMany()`.
3292-
* @param {Boolean} [options.rawResult = false] if false, the returned promise resolves to the documents that passed mongoose document validation. If `true`, will return the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~insertWriteOpCallback) with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`.
3293-
* @param {Boolean} [options.lean = false] if `true`, skips hydrating and validating the documents. This option is useful if you need the extra performance, but Mongoose won't validate the documents before inserting.
3294-
* @param {Number} [options.limit = null] this limits the number of documents being processed (validation/casting) by mongoose in parallel, this does **NOT** send the documents in batches to MongoDB. Use this option if you're processing a large number of documents and your app is running out of memory.
3295-
* @param {String|Object|Array} [options.populate = null] populates the result documents. This option is a no-op if `rawResult` is set.
3291+
* @param {Boolean} [options.ordered=true] if true, will fail fast on the first error encountered. If false, will insert all the documents it can and report errors later. An `insertMany()` with `ordered = false` is called an "unordered" `insertMany()`.
3292+
* @param {Boolean} [options.rawResult=false] if false, the returned promise resolves to the documents that passed mongoose document validation. If `true`, will return the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~insertWriteOpCallback) with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`.
3293+
* @param {Boolean} [options.lean=false] if `true`, skips hydrating and validating the documents. This option is useful if you need the extra performance, but Mongoose won't validate the documents before inserting.
3294+
* @param {Number} [options.limit=null] this limits the number of documents being processed (validation/casting) by mongoose in parallel, this does **NOT** send the documents in batches to MongoDB. Use this option if you're processing a large number of documents and your app is running out of memory.
3295+
* @param {String|Object|Array} [options.populate=null] populates the result documents. This option is a no-op if `rawResult` is set.
32963296
* @param {Function} [callback] callback
32973297
* @return {Promise} resolving to the raw result from the MongoDB driver if `options.rawResult` was `true`, or the documents that passed validation, otherwise
32983298
* @api public
@@ -3765,7 +3765,7 @@ Model.buildBulkWriteOperations = function buildBulkWriteOperations(documents, op
37653765
* const mongooseCandy = Candy.hydrate({ _id: '54108337212ffb6d459f854c', type: 'jelly bean' });
37663766
*
37673767
* @param {Object} obj
3768-
* @param {Object|String|Array<String>} [projection] optional projection containing which fields should be selected for this document
3768+
* @param {Object|String|String[]} [projection] optional projection containing which fields should be selected for this document
37693769
* @return {Document} document instance
37703770
* @api public
37713771
*/

lib/query.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ Query.prototype.projection = function(arg) {
10691069
* @method select
10701070
* @memberOf Query
10711071
* @instance
1072-
* @param {Object|String|Array<String>} arg
1072+
* @param {Object|String|String[]} arg
10731073
* @return {Query} this
10741074
* @see SchemaType
10751075
* @api public
@@ -5038,7 +5038,7 @@ function castQuery(query) {
50385038
* a response for each query has also been returned, the results are passed to
50395039
* the callback.
50405040
*
5041-
* @param {Object|String|Array<String>} path either the path(s) to populate or an object specifying all parameters
5041+
* @param {Object|String|String[]} path either the path(s) to populate or an object specifying all parameters
50425042
* @param {Object|String} [select] Field selection for the population query
50435043
* @param {Model} [model] The model you wish to use for population. If not specified, populate will look up the model by the name in the Schema's `ref` field.
50445044
* @param {Object} [match] Conditions for the population query

0 commit comments

Comments
 (0)