Not able to call a db?

I have two separate clusters as I am following along with M001: MongoDB Basics course. These clusters have one of the db with the same name (video). As you can see below I can access any of the dbs in the cluster(name m001 snadbox) but when I try to use db (video) it always returns the one from the other cluster(cluster0-shard-00-01) which I am not even connected to in compass.

Screenshot from 2020-09-01 17-06-45

I am using ubuntu 20.04 and I am running this in the terminal:

mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,sandbox.a5jmd.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

Your connection string is not ok.It has mixed cluster names

Use the correct string

Hi @Mohammad_Alquraishi,

It looks like you are connected to your Sandbox cluster through Compass and you are connected to the class Atlas cluster through the mongo shell.

All the dbs listed in both the cluster looks good to me.

What exactly are you trying to do here ?

~ Shubham

1 Like

Hi @Shubham_Ranjan,

when I try to use video db it return the db from cluster(cluster0-shard-00-01) but not able to return the cluster sandbox

To access the DB that resides on your sandbox cluster you must be connected to your sandbox cluster.

I am connected and I do have access to the dbs within the sandbox cluster. My only problem is with one of the db named (video) which return data from another cluster that I am not connected to in the above example.

This is impossible.

Your mongo shell is connected to one cluster and your Compass to another one.

But somebody already told you that.

Hi @steevej-1495,
I was confused and did not understand how to connect to the shall. I went back to Atlas and clicked on connect >> connect with mongo shall and copied the string and pasted in the terminal.

Thanks for trying to help. I finished this course.