Bash: mongo: command not found

mongo “mongodb+srv://sandbox.1dbyi.mongodb.net/sandbox” --username m001-student --password m001-mongodb-basics

I have been using the above link for over 3 weeks now and suddenly it started giving me an error.
The error is: bash: mongo: command not found

How can I fix this?
I read topics about it but still getting the same problem.
Thanks

Hello again !

Try this string

mongo "mongodb+srv://sandbox.1dbyi.mongodb.net/sandbox" -u m001-student 

where I replaced the quotation type from to ". It will prompt you for the password.

Hi Miranda,
Thanks for your help.
I did and got : command not found

I see. I’m assuming you’re connecting from your terminal (not Atlas IDE), then we can check if for some reason mongo was uninstalled, or if it has been removed from the $PATH

This information will be given by typing:

  1. whereis mongo
  2. echo $PATH

Of course, you can still use Atlas to get things done if you need.

@Santiago_Miranda
Thank you for coming to my rescue.
I did the echo $PATH command as you mentioned and set the path in my env variable and now it’s up and running.
Thank you again.
Take care.

You’re welcome, hope you don’t mind…

  • add info and mark your reply as a solution for other people.
  • Remember you can use markdown, which makes code way nicer to read ` $PATH ` will appear $PATH.
  • improve the title name to be more helpful for the community. (not sure if this is possible though).

Good luck :slight_smile:

Ok I will.
Thanks