About the Chapter 1: Compass Connection [Solution]

Discussion about Chapter 1- Basic Queries, Connection Problems, Compass Related Queries

Discussion about Chapter 1- Basic Queries, Connection Problems, Compass Related Queries

Compass Installation

Just wanted to underline that for this course you will need the Compass Stable version (Download from here), which you can try out for free. The Compass Community versions lack specific functionality that is used in some of the lessons.
Again, MongoDB Compass Enterprise (Stable) is free of charge for evaluation purposes.

Compass Connection, [Solution] Could not connect to MongoDB on the provided host and port

If you are unable to Connect with Compass, please ensure the following:

  • Parameters:

    Hostname: cluster0-shard-00-00-jxeqq.mongodb.net
    Username: m001-student
    Password: m001-mongodb-basics
    Replica Set Name: Cluster0-shard-0
    Read Preference: Primary Prefered
    
  • You have filled in all fields and are not relying on the auto-filed fields.

  • There are no whitespaces copied in the fields.

  • Try to switch off SRV Record (incase it was switched on)

  • Generally, if you are unable to connect to the Mongo server after filling everything correctly or following the above steps, it is primarily because the network is blocking your requests to the Atlas server. So, to resolve this problem, you should do the following:

~$ telnet cluster0-shard-00-00-jxeqq.mongodb.net 27017
Trying 34.195.121.130...
Connected to ec2-34-195-121-130.compute-1.amazonaws.com.

  • Also, can you go to your browser and try http://cluster0-shard-00-00-jxeqq.mongodb.net:27017/ . The output should be:
    It looks like you are trying to access MongoDB over HTTP on the native driver port.
    If you get the above message, then that means you can access Atlas.
  • Incase, your network is blocking the request, it would be advisable to work with your network admin to unblock the request or try from your home network.

Compass Connection: [Solution]An error occurred while loading navigation: ‘not master and slaveOk=false’

Please ensure the following:

  1. Make sure it is MongoDB Compass Stable version i.e 1.16.1
  2. Ensure that you have written all the parameter names correctly. No whitespace should be trailing in the cluster name.
  3. Try to switch off SRV Record (incase it was switched on)
    If the above points don’t resolve your issue, then quit Compass, klll The MongoDB GUI process and start Compass. Ensure all the above points are met and connect.

If the above step still does not solve your problem, then please follow the above point of quitting Compass, killing the process and re-install Compass.

If you are having any trouble during this chapter, please do not hesitate to post those issues to this forum and we’ll try to help.

We hope you enjoy your time with us and learn lots about MongoDB.

15 Likes

I have the next error when I try to connect
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.

Any idea?
Thanks

Hello! I have the same mistake. How to fix it?

{screen : “https://screenshots.firefox.com/sBFVnEzNP5QEXbDI/prnt.sc
}

the connection to the database in the compass version 1.15 lets you drop the database and the collection. I think this is dangerous.

Hi Oleg_11577, Carlos_82724

By looking at the error, I would cross-check my connection parameters. Sometimes, while copying the username and password, we tend to copy whitespaces which cause such problems. Here are some checks:

Let me know in case of any issues.

Kanika

5 Likes