You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and the [Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html).
844
844
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
845
845
* @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/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.
846
-
* @param {Function} [callback]
847
846
* @return {Query}
848
847
* @api public
849
848
* @memberOf Document
@@ -3444,12 +3443,11 @@ function _checkImmutableSubpaths(subdoc, schematype, priorVal) {
3444
3443
* @param {Number} [options.wtimeout] sets a [timeout for the write concern](https://www.mongodb.com/docs/manual/reference/write-concern/#wtimeout). Overrides the [schema-level `writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern).
3445
3444
* @param {Boolean} [options.checkKeys=true] the MongoDB driver prevents you from saving keys that start with '$' or contain '.' by default. Set this option to `false` to skip that check. See [restrictions on field names](https://www.mongodb.com/docs/manual/reference/limits/#Restrictions-on-Field-Names)
3446
3445
* @param {Boolean} [options.timestamps=true] if `false` and [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this `save()`.
3447
-
* @param {Function} [fn] optional callback
3448
3446
* @method save
3449
3447
* @memberOf Document
3450
3448
* @instance
3451
3449
* @throws {DocumentNotFoundError} if this [save updates an existing document](https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew()) but the document doesn't exist in the database. For example, you will get this error if the document is [deleted between when you retrieved the document and when you saved it](documents.html#updating).
3452
-
* @return {Promise|undefined} Returns undefined if used with callback or a Promise otherwise.
Copy file name to clipboardExpand all lines: lib/model.js
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2231,7 +2231,7 @@ Model.$where = function $where() {
2231
2231
/**
2232
2232
* Issues a mongodb findOneAndUpdate command.
2233
2233
*
2234
-
* Finds a matching document, updates it according to the `update` arg, passing any `options`, and returns the found document (if any) to the callback. The query executes if `callback` is passed else a Query object is returned.
2234
+
* Finds a matching document, updates it according to the `update` arg, passing any `options`. A Query object is returned.
2235
2235
*
2236
2236
* #### Example:
2237
2237
*
@@ -3643,7 +3643,11 @@ Model.castObject = function castObject(obj, options) {
* @param {Object} [options.options=null] Additional options like `limit` and `lean`.
4239
4239
* @param {Function} [options.transform=null] Function that Mongoose will call on every populated document that allows you to transform the populated document.
4240
4240
* @param {Boolean} [options.forceRepopulate=true] Set to `false` to prevent Mongoose from repopulating paths that are already populated
4241
-
* @param {Function} [callback(err,doc)] Optional callback, executed upon completion. Receives `err` and the `doc(s)`.
0 commit comments