Navigation

    Install mongosh

    Info With Circle IconCreated with Sketch.Note
    Beta

    The MongoDB Shell (mongosh) is currently available as a Beta release. The product, its features, and the corresponding documentation may change during the Beta stage.

    To use the MongoDB Shell, you must have a MongoDB deployment to connect to.

    1

    Open the MongoDB Download Center.

    2
    3
    4

    Ensure that the extracted MongoDB Shell binary is in the desired location in your filesystem, then add that location to your PATH environment variable.

    To add the MongoDB Shell binary's location to your PATH environment variable:

    1. Open the Control Panel.
    2. In the System and Security category, click System.
    3. Click Advanced system settings. The System Properties modal displays.
    4. Click Environment Variables.
    5. In the System variables section, select Path and click Edit. The Edit environment variable modal displays.
    6. Click New and add the filepath to your mongosh binary.
    7. Click OK to confirm your changes. On each other modal, click OK to confirm your changes.

    To confirm that your PATH environment variable is correctly configured to find mongosh, open a command prompt and enter the mongosh --help command. If your PATH is configured correctly, a list of valid commands displays.

    Info With Circle IconCreated with Sketch.Note

    mongosh preferences are stored by default in the directory C:\Users\<username>\AppData\Roaming.

    Important With Circle IconCreated with Sketch.Important
    Windows Users

    mongosh preferences are stored by default in the directory C:\Users\<username>'\.mongodb\mongosh.

    Once you successfully install mongosh, learn how to connect to your MongoDB deployment.

    Give Feedback