We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e563d8c commit c573bd1Copy full SHA for c573bd1
src/cursor/find_cursor.ts
@@ -412,8 +412,15 @@ export class FindCursor<TSchema = any> extends AbstractCursor<TSchema> {
412
* @remarks
413
* {@link https://docs.mongodb.com/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation}
414
*/
415
- allowDiskUse(): this {
+ allowDiskUse(allow = true): this {
416
assertUninitialized(this);
417
+
418
+ // As of 6.0 the default is true. This allows users to get back to the old behaviour.
419
+ if (!allow) {
420
+ this[kBuiltOptions].allowDiskUse = false;
421
+ return this;
422
+ }
423
424
if (!this[kBuiltOptions].sort) {
425
throw new MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification');
426
}
0 commit comments