ApsaraDB for MongoDB supports the following database versions: 3.2, 3.4, 4.0, and 4.2. We recommend that you use drivers running the same database version as the ApsaraDB for MongoDB instance to access it. You can download drivers in different languages from the MongoDB official website.
Note For more information about differences between the database versions, see MongoDB versions and storage engines.
How do I view the database version of an ApsaraDB for MongoDB instance?
- You can connect to a replica set instance by using the mongo shell. For more information, see Connect to a replica set instance by using the mongo shell.
- Run the following command to view the database version:
db.version()The command output shows that the database version is 4.0.0.
mgset-12xxxx:PRIMARY> db.version() 4.0.0