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.

2 results found

  1. 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)
  2. 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)
  • Don't see your idea?

MongoDB Shell

Categories

Feedback and Knowledge Base