Skip to content

Commit 48e9ebc

Browse files
committed
style: update "options.sort" and "options.select" type for suggestion
1 parent 099db00 commit 48e9ebc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/model.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ Model.$where = function $where() {
25222522
* @param {Boolean} [options.new=false] if true, return the modified document rather than the original
25232523
* @param {Object|String} [options.fields] Field selection. Equivalent to `.select(fields).findOneAndUpdate()`
25242524
* @param {Number} [options.maxTimeMS] puts a time limit on the query - requires mongodb >= 2.6.0
2525-
* @param {Any} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. TODO: Update type to proper type
2525+
* @param {Object|String} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update.
25262526
* @param {Boolean} [options.runValidators] if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema
25272527
* @param {Boolean} [options.setDefaultsOnInsert=true] If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created
25282528
* @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html)
@@ -2648,13 +2648,13 @@ function _decorateUpdateWithVersionKey(update, options, versionKey) {
26482648
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
26492649
* @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.
26502650
* @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({ _id: id }, update, options, callback)](https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndReplace).
2651-
* @param {Any} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. TODO: Update type to proper type
2651+
* @param {Object|String} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update.
26522652
* @param {Boolean} [options.runValidators] if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema
26532653
* @param {Boolean} [options.setDefaultsOnInsert=true] If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created
26542654
* @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html)
26552655
* @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document
26562656
* @param {Boolean} [options.new=false] if true, return the modified document rather than the original
2657-
* @param {Any} [options.select] sets the document fields to return. TODO: Update type to proper type
2657+
* @param {Object|String} [options.select] sets the document fields to return.
26582658
* @param {Function} [callback]
26592659
* @return {Query}
26602660
* @see Model.findOneAndUpdate #model_Model.findOneAndUpdate
@@ -2831,9 +2831,9 @@ Model.findByIdAndDelete = function(id, options, callback) {
28312831
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
28322832
* @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.
28332833
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2834-
* @param {Any} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. TODO: Update type to proper type
2834+
* @param {Object|String} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update.
28352835
* @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html)
2836-
* @param {Any} [options.select] sets the document fields to return. TODO: Update type to proper type
2836+
* @param {Object|String} [options.select] sets the document fields to return.
28372837
* @param {Number} [options.maxTimeMS] puts a time limit on the query - requires mongodb >= 2.6.0
28382838
* @param {Function} [callback]
28392839
* @return {Query}
@@ -2911,9 +2911,9 @@ Model.findOneAndReplace = function(filter, replacement, options, callback) {
29112911
* @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html).
29122912
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
29132913
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2914-
* @param {Any} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. TODO: Update type to proper type
2914+
* @param {Object|String} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update.
29152915
* @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html)
2916-
* @param {Any} [options.select] sets the document fields to return. TODO: Update type to proper type
2916+
* @param {Object|String} [options.select] sets the document fields to return.
29172917
* @param {Number} [options.maxTimeMS] puts a time limit on the query - requires mongodb >= 2.6.0
29182918
* @param {Function} [callback]
29192919
* @return {Query}
@@ -2974,9 +2974,9 @@ Model.findOneAndRemove = function(conditions, options, callback) {
29742974
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
29752975
* @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html).
29762976
* @param {Object|String|String[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select)
2977-
* @param {Any} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. TODO: Update type to proper type
2977+
* @param {Object|String} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update.
29782978
* @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html)
2979-
* @param {Any} [options.select] sets the document fields to return. TODO: Update type to proper type
2979+
* @param {Object|String} [options.select] sets the document fields to return.
29802980
* @param {Function} [callback]
29812981
* @return {Query}
29822982
* @see Model.findOneAndRemove #model_Model.findOneAndRemove

0 commit comments

Comments
 (0)