Skip to content

Commit

Permalink
docs(returnOriginal): clarify that returnOriginal doesn't set new
Browse files Browse the repository at this point in the history
…, and link to `findOneAndUpdate()` tutorial
  • Loading branch information
vkarpov15 committed Jul 19, 2020
1 parent 402de9c commit 04f9a7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -147,7 +147,7 @@ Mongoose.prototype.driver = require('./driver');
*
* Currently supported options are:
* - 'debug': If `true`, prints the operations mongoose sends to MongoDB to the console. If a writable stream is passed, it will log to that stream, without colorization. If a callback function is passed, it will receive the collection name, the method name, then all arugments passed to the method. For example, if you wanted to replicate the default logging, you could output from the callback `Mongoose: ${collectionName}.${methodName}(${methodArgs.join(', ')})`.
* - 'returnOriginal': If `false`, changes the default `new` option to `findOneAndUpdate()`, `findByIdAndUpdate` and `findOneAndReplace()` to true.
* - 'returnOriginal': If `false`, changes the default `returnOriginal` option to `findOneAndUpdate()`, `findByIdAndUpdate`, and `findOneAndReplace()` to false. This is equivalent to setting the `new` option to `true` for `findOneAndX()` calls by default. Read our [`findOneAndUpdate()` tutorial](/docs/tutorials/findoneandupdate.html) for more information.
* - 'bufferCommands': enable/disable mongoose's buffering mechanism for all connections and models
* - 'useCreateIndex': false by default. Set to `true` to make Mongoose's default index build use `createIndex()` instead of `ensureIndex()` to avoid deprecation warnings from the MongoDB driver.
* - 'useFindAndModify': true by default. Set to `false` to make `findOneAndUpdate()` and `findOneAndRemove()` use native `findOneAndUpdate()` rather than `findAndModify()`.
Expand Down

0 comments on commit 04f9a7a

Please sign in to comment.