I am new to MongoDB. I already read the
but, I tried to run the "mongo" command: It is not working!!
...So i did:
sudo apt install mongodb-clients
(I saw after that this command uninstalled the mongodb server, which i had to install again)
When it finished, i tried again the "mongo" command. It is not working !! How do I solve this?
CodePudding user response:
You may want to try "mongosh" command.
As specified on documentation you provided.
Start a mongosh session on the same host machine as the mongod. You can run mongosh without any command-line options to connect to a mongod that is running on your localhost with default port 27017.
You need a client in order to interact with mongoDB deployment such as mongosh or Compass.
The MongoDB Shell, mongosh, is a fully functional JavaScript and Node.js 16.x REPL environment for interacting with MongoDB deployments. You can use the MongoDB Shell to test queries and operations directly with your database.
Hope It helps.
CodePudding user response:
The mongodb-server
and the mongodb-clients
debian packages were for MongoDB 3.x, maintained by Ubuntu.
For MongoDB 4.x, MongoDB provide their own debian packages, but they named them mongodb-org-server
, mongodb-mongosh
and mongodb-cli
. The client command mongo
is split into two different commands mongocli
and mongosh
.