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)
- Large Language Models (LLMs): Four Critical Modeling Stages - August 4, 2025
- Agentic Workflow Design Patterns Explained with Examples - August 3, 2025
- What is Data Strategy? - August 2, 2025
I found it very helpful. However the differences are not too understandable for me