Connect: 'not master and slaveOk=false':

the new version of compass has (as it seems) a new Interface: everything in one line. Exzellent. So I typed

mongodb://m001-student:m001-mongodb-basics@cluster0-shard-00-00-jxeqq.mongodb.net:27017

and got (automatism, Wonderful automatism)

mongodb://m001-student:m001-mongodb-basics@cluster0-shard-00-00-jxeqq.mongodb.net:27017/admin?authSource=admin&readPreference=primary&appname=MongoDB%20Compass&ssl=true

And this leads to:

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.

And now I’m stuck.
What is the universes master-key?

Include the other two nodes in the connection string separated by commas. Also look into including the name of the replica set.

I’m in lesson:
https://university.mongodb.com/mercury/M001/2020_February_25/chapter/Chapter_1_Introduction/lesson/594d8f1e8c07c3a9b60bdfb3/lecture. there an no other notes (I#ve never ever heart the word “node”)

only:
4. Use the following information to complete this form, but do not click “Connect” yet. Hostname: cluster0-shard-00-00-jxeqq.mongodb.net Username: m001-student Password: m001-mongodb-basics Replica Set Name: Cluster0-shard-0 Read Preference: Primary Preferred
5. Click “Add to Favorites” and enter M001 RS as the Favorite Name . Adding this connection as a favorite will enable you to easily reconnect to our class MongoDB deployment after closing and restarting Compass.
6. Now, click “Connect” and load the databases in the M001 class MongoDB deployment.

The lectures are a bit behind with the new version. Here, try this one:

mongodb://m001-student:m001-mongodb-basics@cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?authSource=admin&replicaSet=Cluster0-shard-0%2Ftest&readPreference=primary&appname=MongoDB%20Compass&ssl=true

Paste it here:

3 Likes

If you are not overwhelmed about connection strings I would like to encourage you to read more about it and in particular about the new SRV style. You can find some information at https://docs.mongodb.com/manual/reference/connection-string/ even if it is outside the scope of this course.

In the case of the shared cluster for M001 the SRV URI is simply mongodb+srv://m001-student:m001-mongodb-basics@cluster0-jxeqq.mongodb.net

1 Like

worked like a charm (or cat or Schoko-Eiscreme)
thank you.

Closing this thread as the issue has been resolved.