Stuck on chapter 0

I am trying to follow the instructions on setting up mongodb but I have several issues. First, I already installed community version on my computer, do I really need the enterprise? I also cannot seem to connect using mongo shell, I get a sintax error. Is that because I am not using enterprise version?

No need to install enterprise version, we can also connect via community version mongo shell

run this command on your cli or terminal ::

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^C

1 Like

I did the course with the community version so it should still work for you. If you share the syntax error we may be able to help.

Thanks for the feedback, I managed to fix the syntax error by running the mongo command and the connection string from the bin folder(I am using command propmpt).

hi Filip, how did you fix this issue, I am also facing the same and not able to resolve it. Getting this error when running command given in lecture notes – 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
2019-01-14T12:54:40.899+0530 E QUERY [js] SyntaxError: missing ; before statement @(shell):1:6

Using command prompt, navigate to your instalation folder, in my case it was c/Program Files/MongoDB/Server/4.0/bin and from there you can run whatever mongo command you need to, or in your case this command: 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^C Hope that helps!

1 Like

Oh God, your answer saved my day.

Hey can you help with the connection. I am using 4.0.5 enterprise version. There is no server folder in my program files. Just bin and other folders.

I think it is quite strange that you do not have the Server folder but the important thing is to navigate to the bin folder. As long as the bin folder contains the mongo file I think you should be fine. When you navigate to the bin folder with your command prompt, run the mongo command.

Do we have add anything to windows path in control panel?

Thanks @Filip_48750, it worked.

No problem I am glad I could help. By the way it is recommended in the MongoDB documentation that you add it to the path variable.If you do that you will be able to use the mongo command directly without navigating to the bin folder. Otherwise you will need to repeat the process every time you want to use the shell.

Try to run mongo command in the bin folder, it worked for me