When trying to access MongoDB database collection data using command such as show collections on one of the secondary member of the replica set, error message such as not master and slaveOk=false occurs. Following screenshot represents the same:

Figure 1. MongoDB – SlaveOk Error Message
Following command when executed on secondaries resolves the above shown error:
rs.slaveOk();
- Paired Sample T-Tests: Formula, Examples - January 27, 2023
- Hidden Markov Models Explained with Examples - January 27, 2023
- Pearson Correlation Coefficient & Statistical Significance - January 26, 2023
Leave a Reply