node.js - "Secondary" vs "Slave" in Mongodb -
node.js - "Secondary" vs "Slave" in Mongodb -
i trying clarify terminology difference, if any, between "secondary" , "slave" in mongodb.
confusion stems connecting w/ node-mongodb-native documentation of db constructor:
db_opts = {db: { readpreference: readpreference.secondary slaveok: true }} mongoclient.connect('mongodb://example', db_opts, ...)
what difference between readpreference alternative , slaveok alternative there?
don't caught on secondary vs. slave here. you're asking slaveok vs readpreference.
slaveok
deprecated in favor of using readpreference
. mongoclient docs explicitly state slaveok: "legacy alternative allowing reads secondary, utilize readprefrence instead". state setting readpreference overrides slaveok value.
node.js mongodb
Comments
Post a Comment