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. 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)
  2. 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)
  3. 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)
  4. 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)
  5. Make Load() support Regex Patterns or make a new loadRegex() function

    Problem Statement/Rationale

    Let's say you have a directory full of scripts.

    For now, I need to do a load('script path') for each script.

    Wouldn't it be great if I could do load('*') within the directory, and load them all one after the other with this one liner ?

    Expected Results

    load(/*/) -> all the files in the directory, sorted by alphanumerical (maybe we could also configure a locale in mongo configuration file or something like that to change collation)

    Actual Results

    load(Regex Pattern) doesn't work, because it searches a path.

    Additional Notes

    if it's too complicated to make load compatible…

    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)
  6. Add support for AWS SSO when authMechanism is MONGODB-AWS

    Currently MONGODB-AWS authentication mechanism doesn't support AWS SSO. User has to manually run aws sso get-role-credentials to retrieve the temporary credentials first.

    All AWS SDK support SSO out of the box, therefore mongosh should add support for it too.

    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)
  7. 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)
  8. Support git command

    MongoSh is a developer tool, obviously. So as a developer, git is always a part of it. Supporting git command inside mongosh will help us save a lot of time.

    Here's some of my implementation:

    const git = (command) => {
    try {
    return execSync(`git ${command}`).toString();
    } catch (e) {};
    return null;
    };
    const listBranches = () => {
    const branches = git(`branch -a`).split(/\r\n|\n|\r/).filter(notEmpty);
    return branches.map(branchObj);
    };
    const pull = (remote = 'origin') => {
    return git(`pull ${remote} --rebase`);
    };
    const log = (cnt) => {
    const _cnt = Number(cnt) || 32;
    return git(`log --graph --all --oneline --decorate=short --max-count=${_cnt}`);
    }

    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)
  9. Suggest new feature for loading scripts: loadScript and loadFolder

    For loading external script into MongoSh current session, currently we have the load() function, which is enough for the task. But I found myself using my own functions instead. So I would like to describe those as suggestion to improve MongoSh:

    loadScript()

    This function is basically has the same function with load(). But has 1 major difference: all relative paths in the script has the same base directory with the script itself, not the current MongoSh working directory.
    For example:
    - Script "D:\MyProject\src\script.js" have these references: "test.js", "../test2.js"
    - Current working dir process.cwd(): "C:\MongoSh"
    - Path resolved…

    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)
  10. Extended JSON v2

    Allow the use of Extended JSON v2 for e.g. inserting or finding documents.

    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)
  11. Retain multi-line input in history.

    Ideally, when using an inline text editor, the inline text editor would show the history command with its multi-lines retained.

    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)
  12. 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)
  13. Add a command to change date format when logrotate is used

    After testing db.adminCommand( { logRotate : 1 } ), the following file was generated:
    /var/log/mongodb/mongod.log.2021-07-05T15-09-17. It would be good to add command to change date format. E.g. yyyymmdd-hhmmss and also it could be specified as variable in mongod.conf

    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

    1 comment  ·  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. Change naming conventions to more inclusive terms. For example "slaveDelay" to "workerDelay" or "rs.isMaster" to "rs.isMain"

    There is an initiative in the tech community to replace non-inclusive terms with more inclusive ones and I'd like to get the community's take on it. I think the biggest offenders are terminology referring to "slaves" and "masters", but I'm sure there are others that might fall into that category. Although I'm sure nobody meant any harm by using these terms, I think we can and should do better.

    I'm currently working my way through the m103 replication course and I see in replication configuring there's a term "slaveDelay". Also a "rs.isMaster()" method. I'm suggesting replacing "slave" with "worker" and…

    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

    started  ·  2 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)
  15. Paginate shell output

    When running a query or a command that returns a long output, the content scrolls off the screen and cannot be seen without using the terminal scrollbar.

    It would be nice if the content would only scroll to screen boundaries and pause like more or less.

    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)
  16. create custom role with list of collection

    currently, when creating a role, we need to list one collection per db for custom role

    db.getSisterDB('admin').createRole({role : 'readWriteCollectionXY',
    privileges : [ {resource : {db : "databaseA", collection : "***"}, actions : ["find", "insert", "update"]},
    {resource : {db : "database
    A", collection : "yyy"}, actions : ["find", "insert", "update"]} ],
    roles : []
    })

    having an option to list all the collections in one db with the same permission would be a nice thing to have.

    db.getSisterDB('admin').createRole({role : 'readWriteCollectionXY',
    privileges : [ {resource : {db : "database_A", collections : ["***", "yyy"] }, actions : ["find", "insert", "update"]} ],
    roles…

    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 Next →
  • Don't see your idea?

MongoDB Shell

Categories

Feedback and Knowledge Base