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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -