diff --git a/lib/document.js b/lib/document.js index 85a65d355d8..b2bb281ad79 100644 --- a/lib/document.js +++ b/lib/document.js @@ -831,7 +831,7 @@ function init(self, obj, doc, opts, prefix) { * * #### Example: * - * weirdCar.updateOne({$inc: {wheels:1}}, { w: 1 }, callback); + * weirdCar.updateOne({$inc: {wheels:1}}, { w: 1 }); * * #### Valid options: * @@ -843,7 +843,6 @@ function init(self, obj, doc, opts, prefix) { * @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). * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) * @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. - * @param {Function} [callback] * @return {Query} * @api public * @memberOf Document @@ -3439,12 +3438,11 @@ function _checkImmutableSubpaths(subdoc, schematype, priorVal) { * @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). * @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) * @param {Boolean} [options.timestamps=true] if `false` and [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this `save()`. - * @param {Function} [fn] optional callback * @method save * @memberOf Document * @instance * @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). - * @return {Promise|undefined} Returns undefined if used with callback or a Promise otherwise. + * @return {Promise} * @api public * @see middleware https://mongoosejs.com/docs/middleware.html */