mongodb-js / mongodb-schema

Infer a probabilistic schema for a MongoDB collection.

Home Page:https://github.com/mongodb-js/mongodb-schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

connect to secondary node with slaveOk=true

matt453 opened this issue · comments

I would like to be able to use the CLI version against one of the secondary nodes in our replicaSet. but if I pass it as an option I get errors

mongodb-schema mongodb://USERNAM:PASSWORD@HOST:PORT/AUTH_DB?slaveOk=true DATABASE.COLLECTION --no-values -n 100

/usr/local/lib/node_modules/mongodb-schema/node_modules/mongodb/lib/utils.js:132
      throw err;
      ^
MongoError: not master and slaveOk=false
    at /usr/local/lib/node_modules/mongodb-schema/node_modules/mongodb-core/lib/connection/pool.js:593:63
    at authenticateStragglers (/usr/local/lib/node_modules/mongodb-schema/node_modules/mongodb-core/lib/connection/pool.js:516:16)
    at Connection.messageHandler (/usr/local/lib/node_modules/mongodb-schema/node_modules/mongodb-core/lib/connection/pool.js:552:5)
    at emitMessageHandler (/usr/local/lib/node_modules/mongodb-schema/node_modules/mongodb-core/lib/connection/connection.js:309:10)
    at Socket.<anonymous> (/usr/local/lib/node_modules/mongodb-schema/node_modules/mongodb-core/lib/connection/connection.js:452:17)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)