mongo --shell
will open the shell interface.
https://docs.mongodb.com/manual/reference/program/mongo/
Answer from shakhawat on Stack OverflowHow to start mongodb shell? - Stack Overflow
Use [DB] for Mongodb with shell - Stack Overflow
Mongodb shell is not uninstalled
MongoDB Cheat Sheet - Essential MongoDB Shell Commands
Videos
mongo --shell
will open the shell interface.
https://docs.mongodb.com/manual/reference/program/mongo/
Both the mongod (database server) and mongo (database client shell) programs are command line programs and each expects to be run in its own command line session. So, after starting the server (as you did with "./mongod") you should open a second command line session and run "./mongo" in it to give you a command line shell for talking to the server.
I just got it. You can just add the database name:
mongo [dbname] --host etc.
and it worked.
In your question, you didn't specify what platform you're using, are you using Linux? Windows? Anyway, if you want to use the command line for mongo db then I would recommend to use the mongodb shell. Download the mongodb shell https://www.mongodb.com/try/download/shell and select what platform you're using.