The mongo shell is a client tool that is used to connect to open source MongoDB databases and ApsaraDB for MongoDB instances. This topic describes how to install and use the mongo shell in a Windows operating system.
Install the mongo shell
Go to the MongoDB Community Server Download page.
Select the version, platform, and package of the mongo shell that you want to install, and then click Download.
NoteIn this example, the version is 4.0.28, the platform is Windows, and the package is msi.
To make sure that the client can be authenticated when you connect to an ApsaraDB for MongoDB instance, select MongoDB 3.0 or later.
Double-click the downloaded package and then click Next.
Select I accept the terms in the License Agreement and then click Next.
Click Custom.
Select only Client and then click Next.
Determine whether to select Install MongoDB Compass, and then click Next. In this example, MongoDB Compass is not installed.
Click Install.
After the application is installed, click Finish .
Use the mongo shell
Open the command prompt window and go to the directory in which the mongo.exe program is stored.
Example:
cd C:\Program Files\MongoDB\Server\4.0\bin
After you go to the directory in which mongo.exe is stored, you can use the mongo shell.