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();
Latest posts by Ajitesh Kumar (see all)
- The Watermelon Effect: When Green Metrics Lie - January 25, 2026
- Coefficient of Variation in Regression Modelling: Example - November 9, 2025
- Chunking Strategies for RAG with Examples - November 2, 2025

I found it very helpful. However the differences are not too understandable for me