diff --git a/lib/operations/find.js b/lib/operations/find.js index 4cf697f5f59..97ecdb8d2ba 100644 --- a/lib/operations/find.js +++ b/lib/operations/find.js @@ -20,6 +20,9 @@ class FindOperation extends OperationBase { // copied from `CommandOperationV2`, to be subclassed in the future this.server = server; + // updates readPreference if setReadPreference was called on the cursor + this.readPreference = ReadPreference.resolve(this, this.options); + if (typeof this.cmd.allowDiskUse !== 'undefined' && maxWireVersion(server) < 4) { callback(new MongoError('The `allowDiskUse` option is not supported on MongoDB < 3.2')); return;