Install mongosh
Prerequisites
To use the MongoDB Shell, you must have a MongoDB deployment to connect to.
For a free cloud-hosted deployment, you can use MongoDB Atlas.
To learn how to run a local MongoDB deployment, see Install MongoDB.
Supported MongoDB Versions
You can use the MongoDB Shell to connect to MongoDB version 4.0 or greater.
Procedure
Select the appropriate tab for your operating system:
NOTE
On Windows, mongosh
preferences and configuration options are stored in the %APPDATA%/mongodb/mongosh
directory.
Install from MSI
1Open the MongoDB Shell download page.
Open the MongoDB Download Center.
2In the Platform dropdown, select Windows 64-bit (8.1+) (MSI)
3Click Download.
4Double-click the installer file.
5Follow the prompts to install mongosh
.
Install from .zip
File
1Open the MongoDB Shell download page.
Open the MongoDB Download Center.
2Download the mongosh
installation archive for your operating system.
Download the appropriate version of mongosh
for your operating system. MongoDB also provides versions of mongosh
that use the system's OpenSSL installation. For details, see the MongoDB Download Center.
3Extract the files from the downloaded archive.
4Add the mongosh
binary to your PATH
environment variable.
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:
Open the Control Panel.
In the System and Security category, click System.
Click Advanced system settings. The System Properties modal displays.
Click Environment Variables.
In the System variables section, select Path
and click Edit. The Edit environment variable modal displays.
Click New and add the filepath to your mongosh
binary.
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.
No comments:
Post a Comment