Skip to content

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.

36 results found

  1. mongocli improvemenet

    It would be great to have API/command in mongocli to manage replica set like changing priority of replicate set in case ops manager is not accessible or part of autumation.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Commands  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  2. The new mongosh mangles the output of piped in commands

    With the old mongo shell, you could set up a shell file (called something like mongo_cmd.sh)containing the path to the executable and all the command line switches you wanted like this:

    /path/to/mongo --norc --quiet --port 26011

    and then in your other script files pipe commands into an invocation of mongocmd.sh like the following:
    ```
    CMD
    FILE=./mongo_cmd.sh

    STATS=$(echo 'db.stats().ok' | $CMDFILE)
    DBVERSION=$(echo 'db.version()' | $CMD
    FILE)

    echo "db.stats().ok output:" $STATS
    echo "db.version() output:" $DBVERSION
    ```

    and the output would be this:

    db.stats().ok output: 1
    db.version() output: 6.0.5

    But if you replace mongo with the new shell mongosh in the…

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Scripting  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  3. Single tool for shell, mongodump, mongorestore, mongoexport, mongoimport

    Single tool for the basic database usage, namely, mongodb shell (mongosh), mongodump, mongorestore, mongoexport, mongoimport

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  4. Better mongo file loading performance

    Manage a faster loading of files in command line to have better perfs for multiple small scripts.

    See Case 01251177.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Scripting  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  5. Control logging behavior of mongosh

    It should be possible to control the logging behavior of mongosh, for example:

    • verbosity
    • what to log / log level
    • retention time
    • whether logging is enabled or not
    26 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    7 comments  ·  Usability  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  6. Avoid issuing commands upon connection where the user is unauthorized to execute them

    Presently when a user connects to a MongoDB cluster mongosh will execute several command helpers. Unless the users have specific privileges these commands will trigger several unauthorised messages similar to below:

    {"msg":"Checking authorization failed","attr":{"error":{"code":13,"codeName":"Unauthorized","errmsg":"not authorized on admin to execute command { getParameter: 1, featureCompatibilityVersion: 1, apiVersion: \"1\"... $db: \"admin\" }"}}}
    

    This causes issues for some security monitoring applications, and requires the security monitoring application to be filtered to ignore these events.

    A similar issue is described in the Jira ticket: https://jira.mongodb.org/browse/MONGOSH-1298

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Security  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  7. Support brew keg versioned releases for Macs

    For example, allow "brew install mongosh@1.10.6" and for mongosh 2.x

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Usability  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  8. mongosh parse mongo url offline

    In scripting easiers and most robust way to pass mongodb connection info using url string. Sometimes though there is need to parse part of it, like database name or specific query params. In NodeJS whathg URL can be used for this, additionally validating url. For mongsh only way at the moment is to perform actual connecion to running mongodb:

    mongosh "mongodb://127.0.0.1:27017/staging?serverSelectionTimeoutMS=15000&readPreference=secondaryPreferred" --quiet -eval "print(db)"
    staging_db

    Would be nice if mongosh can be used to parse mongodb URL and output some part of it wihtout need for actual connection. This use case if for bash scripting, currently working on combination of…

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Scripting  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  9. Manage mongosh through MongoDB agent automation

    MongoDB server, database tools, biconnector binaries are all managed by MongoDB agent automation feature in a managed deployments via Opsmanager. Mongosh is not managed, which makes it difficult to build separate automation to manage mongosh alone. If mongodb agent can manage (install/update/remove) mongosh, it would greatly benefit and seamless management of managed deployments.

    6 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Other  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  10. Allow selection of user-specified –mongoshpath directory and –logpath similar to mongod does

    Allow selection of user-specified installation directory options

    For example –installpath [Installdirectory] and –logpath [logDirectory] similar (and save it in a config file). Users would be familiar with this as it is somewhat similar to mongod.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  11. MONGODB-AWS Auth Feature Request for mongosh & compass connections

    I would like to request a feature to more fully integrate the auth mechanism MONGODB-AWS in the Atlas UI. We envision that when you are creating a user based on IAM Auth a toggle button is added in the UI that when enabled on the user or project level, would require a user to provide a session token to authenticate via mongoose. This feature would require the --awsIamSessionToken option when a so defined user connects via mongosh or the token field in Compass (along with the access key and secret access key). Basically, if only username/password were presented, it would…

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Security  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  12. add _prettyShell=false to mongosh

    In 4.4, the mongo shell prints 'ugly' by default. Many of our scripts are written to expect this type of output. The mongo shell includes the command: DBQuery.prototype._prettyShell=false to explicitly set this. In mongosh, there is no built in/native ability to achieve the same output as mongo shell.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Scripting  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  13. Have db.table.distinct('column') support cursors

    Right now distinct() returns max 100 items and doesn't take into account the config "displayBatchSize". It would be nice if distinct() returned all distinct items.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Commands  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  14. Save shell commands to the cloud

    It would be nice to have a way to save shell commands for later, maybe to the cloud.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  15. Don't send tracking analytics without explicit opt-in

    I recently updated mongosh to 1.7.1 via Homebrew. Little Snitch informs me that the program is reaching out to api.segment.io asynchronously. For privacy reasons, I do not want programs to do that, and such analytics without explicit opt-in may be illegal in the entire EU per the GDPR.

    Please remove the analytics/tracking feature or make it configurable only as an opt-in feature.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Security  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  16. 2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  17. Display Atlas cluster name in command prompt, rather than internal slug

    When connected to an Atlas cluster, I can see the Atlas internal hostname slug in the command prompt:

    Atlas atlas-l1ugii-shard-0 [secondary] database_name>

    It would be easier if this displayed the Atlas hostname, that matches the UI, and includes the cluster name (e.g. "Atlas clustername-shard-0 [secondary] databasename>").

    This would help with distinguishing between multiple shell connections across multiple different clusters.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Usability  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  18. Change mongosh to process and use arguments only up to a "--" sentinel

    Getting command line arguments into mongosh is virtually impossible.  The --eval option insists on printing the last eval expr evaluated to the console despite the --quiet switch.  Allowing a script to self parse and manage any args following the "–" sentinel using the "process.argv" array would permit the developer a wide array of choices in handling script input from a command line.

    " > mongosh mongo-options script file – arg arg... "

    Component: mongosh

    Versions: 1.4.x and up

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    4 comments  ·  Scripting  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  19. syntax issues

    I have to use '.\mongosh' rather than '.\mongo' when using Power Shell windows
    Might be useful since the switch to mongoshell

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Usability  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  20. remove case sensitivity from tab search of commands

    currently mongosh uses case sensitive search of command on double tapping the tab key.

    While it seems adequate at first, entering a capital letter requires 2 key presses and it becomes annoying pretty fast for the good old mongo shell users.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Usability  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
← Previous 1
  • Don't see your idea?

MongoDB Shell

Categories

Feedback and Knowledge Base