Unable to connect to Mongo Atlas via Mongo Shell

Tried that , the process went a little further and then same error.

Hi @shubhamverma18,

I’m glad your issue got resolved :slight_smile:

If if didn’t work earlier, I suspect if it would work now without changing any network configuration or setting.

If you have any other issue then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hi @shubhamverma18

Connect to Atlas and click on cluster name ,there it will show primary ,secondary server name .

Use that host name and port to connect MONGO ATLAS Via Mongo Shell.

Above will work without VPN

Hey @Shubham_Ranjan
I thought of making a .bat file when clicked on will automatically connect to Atlas.

But when I run it, the commands are gettings executed infinitely.

As you see I wrote the mongo shell connect command in the mongo.bat file when I click on the file, it is executing infinitely in command prompt.

I want it to execute the command just once.

Hi @shubhamverma18,

This is because you have named it mongo.bat. There is already an executable with the name mongo in the bin directory inside MongoDB folder.

Please rename it to something else such as Sandbox_cluster.bat and it should work fine.

Hope it helps!

If you have any other issue please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

That worked!

But there is this exclamation icon on my cluster.

@Shubham_Ranjan This issue is similar to me. I’m afraid hosting environment for your cloud clusters is not vulnerable if accessed from particular locations or it may also be simply matter of misconfigured hosting environment.

Hi @ajbozdar,

I have surfaced the issue to the relevant team and they are looking into it. I will get back to you as soon as I have any update on this.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Hi shubhamverma18
i am also same situvation
can you guide me
thanking you

Please share a screenshot.
Also, what country are you located?

Hi @venkata_97387,

Can you please share the connection string along with the credentials ?

In addition to that please share the screenshot of the error message that you are getting along with the command that you executed.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Hi @Shubham_Ranjan
finally i connected mongo shell yesterday .
now i am facing anthore error which is i am using insertOne() command in mongo shell like db.movies.insertOne({name: “sai”, director: “yaparla”}) and after executing its says acknowledgement true and when i check in mongo atlas database it doesn’t showing anything also i refresh twice and its shows nothing.
here is mongoshell screenshot


and the database screenshot below

guide me
thanking you

It looks you had a typo an entered use vedio where you should have entered use video.

1 Like

Hi @venkata_97387,

I hope you found @steevej-1495’s response helpful. Please feel free to get back to us if you still have any other query.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

now i am facing anthore error which is i am using insertOne() command in mongo shell like db.movies.insertOne({name: “sai”, director: “yaparla”}) and after executing its says acknowledgement true and when i check in mongo atlas database please verify this

You might be connected to the wrong cluster.

You might be using the wrong database.

If you get

the data is definitively somewhere. You just did not insert at the same place where you are looking.

Hi @venkata_97387,

As @steevej-1495 mentioned, you might be connected to different databases or clusters.

You can check the current database to which you are connected to by just running this command - db and it will print the database name in your console.

Thanks,
Shubham Ranjan
Curriculum Services Engineer