From 04f9a7a5394dfa61b0f3d416fd44df4fc332f322 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Sun, 19 Jul 2020 14:23:38 -0400 Subject: [PATCH] docs(returnOriginal): clarify that `returnOriginal` doesn't set `new`, and link to `findOneAndUpdate()` tutorial --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 324f5af9d63..6a3e5ea2674 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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()`.