Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect to secondary node with slaveOk=true #52

Open
matt453 opened this issue Jun 8, 2018 · 0 comments
Open

connect to secondary node with slaveOk=true #52

matt453 opened this issue Jun 8, 2018 · 0 comments

Comments

@matt453
Copy link

matt453 commented Jun 8, 2018

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant