MongoDB Shell

The MongoDB Shell (mongosh) lets you connect to MongoDB to work with your data and configure your database.

Help us improve the MongoDB Shell by posting your ideas and suggestions for improvements.

To report bugs, please use our MONGOSH JIRA project.

  1. Vi mode for MongoDB Shell

    Please enable a 'vi' editing mode for the mongo shell.

    A first cut of key bindings would be:

    Basic command mode/editing mode toggling:
    i Insert before cursor
    Esc Toggle to command mode

    Cursor motion keys:
    h Move left
    j Move down
    k Move up
    l Move right

    w Move to next word
    b Move to the beginning of the word

    0 Move to the beginning of the line
    $ Move to the end of the line

    And delete/change:
    x delete next character to the right
    d

    {motion} delete amount specified by…

    6 votes
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Usability  ·  Flag idea as inappropriate…  ·  Admin →
  2. Support .mongorc.js file

    A core bit of functionality from the original shell is to support reading from the .mongorc.js file in a user's home directory. This feels like core functionality that mongosh should support.

    4 votes
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Usability  ·  Flag idea as inappropriate…  ·  Admin →
  3. Ability to execute a javascript file from inside the shell

    Currently the only way to execute a javascript file from the mongo shell is to re-direct the input at shell login time (e.g. mongo --username <username> ... < myscript.js). It would be helpful to have a way to execute the script from inside the shell via some sort of "run" command (e.g.from inside the shell "run /my/path/myscript.js".

    3 votes
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Commands  ·  Flag idea as inappropriate…  ·  Admin →
  4. 2 votes
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Commands  ·  Flag idea as inappropriate…  ·  Admin →
  5. creating an option to import csv files with semicolon separator

    There isn't an option to specify semicolon as delimiter on mongo shell when importing csv files. We are forced to import through MongoDB Compass when file has semicolon separator.

    2 votes
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Commands  ·  Flag idea as inappropriate…  ·  Admin →
  6. db connection issue

    i am trying to connect mongo cloud training database using shell propt, i am getting error as below.

    have added my laptop ip, and its approved in the cloud instnace but still getting errorl

    C:\Users\pvenket1>mongo "mongodb+srv://sandbox.9k9vj.mongodb.net/sampletraining" --username m001-student --password password: m001-mongodb-basics
    MongoDB shell version v4.4.1
    connecting to: mongodb://sandbox-shard-00-00.9k9vj.mongodb.net:27017,sandbox-shard-00-01.9k9vj.mongodb.net:27017,sandbox-shard-00-02.9k9vj.mongodb.net:27017/sample
    training?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=atlas-s4l3gu-shard-0&ssl=true

    *** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

    Error: can't connect to new replica set master [sandbox-shard-00-01.9k9vj.mongodb.net:27017], err: AuthenticationFailed: bad auth : Authentication failed. :
    connect@src/mongo/shell/mongo.js:374:17
    @(connect):2:6
    exception: connect failed
    exiting with code 1

    1 vote
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Commands  ·  Flag idea as inappropriate…  ·  Admin →
  7. Course M001: please bring back Chapter 0

    Please put Chapter 0 (installation of MongoDB Shell and Compass) back into course M001. Subsequent chapters refer to the MongoDB Shell and show it being used, but students have not been stepped through the installation process. This chapter was removed on Sept 29. The Sept 22 instance of the course had the step-by-step installation instructions. Using an IDE is not the same, I want students to get hands on with the Shell and with Compass.

    1 vote
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Other  ·  Flag idea as inappropriate…  ·  Admin →
  8. when you hit up, even if last command was an error, edit it

    The most common use case to hit up on the keyboard is that I had a typo in the last command in the shell. When I hit up now, it goes to the most recent valid command not the most recent command.

    What it should do is retype the invalid command I last tried to send, regardless of if it was succesful.

    1 vote
    Sign in Sign in with your MongoDB Account
    Signed in as (Sign out)

    We’ll send you updates on this idea

    under review  ·  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

MongoDB Shell

Categories

Feedback and Knowledge Base