[SERVER-22507] E QUERY [thread1] Error: not master and slaveOk=false : Created: 08/Feb/16  Updated: 08/Feb/16  Resolved: 08/Feb/16

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Sarkhan Allahverdiyev [X] Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Hello,

I am new user in MongoDB. When i query db.getUsers() get following error. How can i resolve this problem?

rs0:SECONDARY> db.getUsers()
2016-02-08T14:47:44.267+0400 E QUERY [thread1] Error: not master and slaveOk=false :
_getErrorWithCode@src/mongo/shell/utils.js:23:13
DB.prototype.getUsers@src/mongo/shell/db.js:1466:1
@(shell):1:1



 Comments   
Comment by Ramon Fernandez Marina [ 08/Feb/16 ]

Sarkhan, you'll need to run rs.slaveOk() to read from a secondary.

Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag, where your question will reach a larger audience.

Regards,
Ramón.

Generated at Thu Feb 08 04:00:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.