How to call SlaveOK on query in Mongoose?
for example, I have this:
SiteModel.find({}, function(err, docs) { .... } );
Should I do this???
SiteModel.slaveOK().find({}, function(err,docs) { ... } );
How to call SlaveOK on query in Mongoose?
for example, I have this:
SiteModel.find({}, function(err, docs) { .... } );
Should I do this???
SiteModel.slaveOK().find({}, function(err,docs) { ... } );
Here's the official example from the Mongoose.js website:
So I guess your example above would probably work, but do it like so:
mongoose.Query.slaveOk
has been deprecated in favour ofmongoose.Query.read(readPreference)
. docsSo, to iterate on the example above: