Docs Menu
Docs Home
/
MongoDB Drivers
/

Azure Cosmos DB Compatibility

On this page

  • Version Information
  • Compatibility
  • Support
Azure Cosmos DB logo

Azure Cosmos DB for MongoDB makes it easy to use Azure Cosmos DB as if it were a MongoDB database. With Azure Cosmos DB, you can run the same application code and use the same drivers and tools that you use with MongoDB.

Azure Cosmos DB for MongoDB implements MongoDB's Wire Protocol to allow MongoDB drivers to connect and interact with Cosmos DB as though it were a MongoDB host. However, this implementation has limitations, as outlined in the Compatibility section of this page.

Azure Cosmos DB supports MongoDB v4.2, or MongoDB v5.0 for vCore clusters. These versions don't support all the newer features and functionality in the versions of MongoDB available on MongoDB Atlas.

Tip

MongoDB Version History

To learn more about the features available in each version of MongoDB, see MongoDB Evolved - Version History.

As of October 2023, Azure Cosmos DB is about 32 percent compatible with the MongoDB API.

On Azure Cosmos DB for MongoDB v4.2, the following MongoDB v4.2 features are available in a limited capacity or are not supported at all:

  • Features: Text indexes, 2d indexes, hashed indexes, case-insensitive indexes, sparse indexes

  • Aggregation Stages: $collStats, $bucket, $bucketAuto, $currentOp, $indexStats, $listLocalSessions, $listSessions, $lookup

To learn more about Azure Cosmos DB's compatibility with MongoDB v4.2, see Microsoft's Azure Cosmos DB for MongoDB (4.2 server version): Supported features and syntax documentation.

For the most current compatibility status between Azure Cosmos DB and MongoDB, see the Is Cosmos DB Compatible with MongoDB Atlas? website.

MongoDB doesn't offer commercial support for Azure Cosmos DB. For help with this product, contact Azure Support.