Unable to disconnect from default server

I get this as soon as I open shell locally:
shellOpen
I am unable to disconnect from this and connect to sandbox cluster. Well I’m quite confused. Could you please clarify what’s happening and how to get on track?

1 Like

Mongo needs a connection string.

This is the address of the cluster you created, which is found under connect in Atlas.

It will look like this:

'mongo  "mongodb+srv://sandbox.ID.mongodb.net/admin" -u m001-student -p m001-mongodb-basics'

Useful links

Although you can run mongoDB in many ways, M001 is especially prepared to use the In-browser IDE.

Oh yes! I found that. So my confusion lies here. This is what I tried:


I am getting an error if I paste the address of the cluster. I referred the following link and figured I am already connected to a cluster.

But show dbs gives the following result:
ss2
Clearly, I am not connected to my sandbox cluster, but connected to something else. So I am really confused on what I can do.

You are already at mongo prompt
Please exit the current connected session and try again from your os prompt

Sorry, what I meant here is, you’re first running mongo alone, hence getting into a NodeJS environment, to localhost (that’s the default URI string, and it means there is a mongod running in the background for some reason.)

Instead, open up a terminal and issue:

mongo  "mongodb+srv://sandbox.ID.mongodb.net/admin" -u m001-student -p m001-mongodb-basics

Okay guys, I’m almost there. Successfully connected through command prompt and can totally use it.
But now if I open mongo shell, its still the same. Can I do something about it? Just wanted to try to use there as well.

Glad to hear. Maybe take a look at the forum posts, you’ll get the answers yourself, and it’d be useful for the future. The search bar is at the right upper corner.