This topic describes how to connect to a standalone ApsaraDB for MongoDB instance by using the mongo shell, which is a database management tool built in MongoDB. You can install the mongo shell on your client or in an ECS instance.
Prerequisites
- Mongo shell 3.0 or later is installed to ensure successful authentication. For more information about the installation process, visit Install MongoDB at the official MongoDB website.
- The IP address of your client is added to a whitelist of the ApsaraDB for MongoDB
instance. For more information, see Configure a whitelist for a standalone ApsaraDB for MongoDB instance.
Note If you want to connect to the instance over the Internet, you must apply for a public endpoint.
Procedure
Common connection scenarios
- Connect a local client to an ApsaraDB for MongoDB instance over the Internet
- How to connect an ECS instance to an ApsaraDB for MongoDB instance when their network types are different
- How to connect an ECS instance to an ApsaraDB for MongoDB instance when they are in different regions
- How to connect an ECS instance to an ApsaraDB for MongoDB instance when they do not belong to the same Alibaba Cloud account