MongoDB Compass error. ‘not master and slaveOk=false’

mongodb

I have just created a MongoDB Atlas instance so that I can give MongoDB a try. I have also downloaded Compass so that I can visually manage the data as I am not familiar with the MongoDB command line at the moment.

After white-listing my IP address in the Atlas dashboard and copying and pasting the connection details I am still unable to fully use the Compass client.

The error that I am receiving is:
An error occurred while loading navigation: 'not master and slaveOk=false': It is recommended to change your read preference in the connection dialog to Primary Preferred or Secondary Preferred or provide a replica set name for a full topology connection.

The operating system on which I am using the Compass client is Windows 10. I am unsure if this is caused by a misconfiguration or something else, however everything is clean and freshly setup.

I would appreciate any tips.

Regards

Best Answer

I received the same error when trying to connect with Compass (version 1.13.1) to a secondary node.

It worked after I changed the connection Hostname to the Primary server, specified the Replica Set Name and select "Secondary Preferred" for the Read Preference.

This seems to be a new feature as older versions of Compass allowed direct connections to secondary nodes without complaint.

Related Topic