This topic describes how to install and use the mongo shell in a Windows operating system. The mongo shell allows you to connect to both MongoDB and ApsaraDB for MongoDB.
Install the mongo shell
- Visit the MongoDB downloading center.
- From the Version drop-down list, select the target MongoDB version.
Note To be authenticated when you connect to an ApsaraDB for MongoDB instance, select MongoDB 3.0 or later.
- Double-click the downloaded software package to start the installation.
Select I accept the terms in the License Agreement and click Next.
- Click Custom.
- Only select Client and click Next.
- Wait until the mongo shell is installed.
Use the mongo shell
Open the command prompt window and go to the directory where the mongo.exe program is stored.
cd C:\Program Files\MongoDB\Server\4.0\bin