skip to Main Content

I am new to MongoDB. I already read the docs and MongoDB Community Edition.
It is working

enter image description here

but, I tried to run the "mongo" command: It is not working!!

enter image description here

…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?

2

Answers


  1. 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.

    Login or Signup to reply.
  2. The mongodb-server and the mongodb-clients debian packages were for MongoDB 3.x, maintained by Ubuntu.

    Since 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search