Shell closes and i can't connect to compass

I had a similar issue at the start of the M001 course to what I’'m having now.

This is the connection string that I’m using.

mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

I believe that I have installed everything correctly. When i open Mongo shell it almost instantly closes. On the off chance that it opens I can’t paste anything into it, such as a connection string, and mostly can’t interact with it at all. When i open mongod before i open shell, shell remains open. Is it correct that this should happen? I still can’t connect to anything though.

When i copy the connection string from the Atlas Requirements lecture “Ctrl + p” will enter only ever a small portion of it and never the whole thing. That fails to connect and i get a "SyntaxError: “” literal not terminated before end of script : "

If I enter the connection string into compass it reads that, "Invalid schema, expected ‘mongodb’ or ‘mongodb+srv’. Can the connection string be modified so that it will connect to compass and then i can use the shell beta there? If i could get the aggregation data to interact with Atlas i could generate a connection string but i cannot get the information onto Atlas.

Is there something that I’m doing obviously wrong. This is incredibly frustrating.

Thanks,

Please show the exact error with screenshot
What exactly you mean by open mongod?

The connect string you are trying is class cluster
All you have to do is open Windows cmd prompt(assuming your os is Windows) and paste the connect string
You should be able to connect

The connect string for Compass is different from shell
You will get it in our forum threads
May be spaces in the command causing issues while pasting
Make sure you are not at mongo prompt while running this command

Good afternoon,

Thanks for your reply.

Hopefully attached are the images that will highlight what the issue is.

command prompt not connectinng

Have you updated mongodb/bin to your PATH?
In your second snapshot you were able to run mongo command successfully as you are in bin directory
In third snapshot you are in a different location.It is unable to find mongo.exe as your path is not updated

Also the syntax error you got is because you are already at mongo prompt(Mongo Enterprise)
As per my last reply you should run mongo and mongod commands at os prompt

1 Like

Good morning,

Thank for your help. I had not created a path for this to work. I was unaware that this needed to be done and i don’t think that it was made very clear.

Learning a lot here.

Thanks,
Al