How Do You Use the MongoDB Command Line?

Problem scenario
You want to enter the MongoDB shell to enter commands interactively.  What do you do?

Solution
1.  Run this command:  /usr/bin/mongo

If the command is not found, do two things:
  a)  Run this: sudo find / -name mongo | grep bin
  b)  Run the mongo file found above (as an executable).

2.  From the prompt ">" enter a command such as this:

db

Leave a comment

Your email address will not be published. Required fields are marked *