|
| 1 | +.. _cosmosdb-compat: |
| 2 | + |
| 3 | +:noprevnext: |
| 4 | + |
| 5 | +============================= |
| 6 | +Azure Cosmos DB Compatibility |
| 7 | +============================= |
| 8 | + |
| 9 | +.. facet:: |
| 10 | + :name: genre |
| 11 | + :values: reference |
| 12 | + |
| 13 | +.. meta:: |
| 14 | + :keywords: microsoft, support |
| 15 | + |
| 16 | +.. contents:: On this page |
| 17 | + :local: |
| 18 | + :backlinks: none |
| 19 | + :depth: 1 |
| 20 | + |
| 21 | +.. figure:: /figures/cosmosdb.png |
| 22 | + :alt: Azure Cosmos DB logo |
| 23 | + |
| 24 | +`Azure Cosmos DB for MongoDB <https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/introduction>`__ |
| 25 | +makes it easy to use Azure Cosmos DB as if it were a MongoDB database. |
| 26 | +With Azure Cosmos DB, you can run the same application code and use the same drivers |
| 27 | +and tools that you use with MongoDB. |
| 28 | + |
| 29 | +Azure Cosmos DB for MongoDB implements MongoDB's |
| 30 | +`Wire Protocol <https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/>`__ |
| 31 | +to allow MongoDB `drivers <https://www.mongodb.com/docs/drivers/>`__ to connect and |
| 32 | +interact with Cosmos DB as though it were a MongoDB host. However, this |
| 33 | +implementation has limitations, as outlined in the :ref:`cosmosdb-compat-section` section |
| 34 | +of this page. |
| 35 | + |
| 36 | +Version Information |
| 37 | +------------------- |
| 38 | + |
| 39 | +Azure Cosmos DB supports MongoDB v4.2, or MongoDB v5.0 for vCore clusters. |
| 40 | +These versions don't support all the newer features and functionality in the versions of |
| 41 | +MongoDB available on `MongoDB Atlas. <https://www.mongodb.com/docs/atlas/>`__ |
| 42 | + |
| 43 | +.. tip:: MongoDB Version History |
| 44 | + |
| 45 | + To learn more about the features available in each version of MongoDB, see |
| 46 | + `MongoDB Evolved - Version History. <https://www.mongodb.com/evolved>`__ |
| 47 | + |
| 48 | +.. _cosmosdb-compat-section: |
| 49 | + |
| 50 | +Compatibility |
| 51 | +------------- |
| 52 | + |
| 53 | +As of October 2023, Azure Cosmos DB is about 32 percent compatible with the |
| 54 | +MongoDB API. |
| 55 | + |
| 56 | +On Azure Cosmos DB for MongoDB v4.2, the following MongoDB v4.2 features are |
| 57 | +available in a limited capacity or are not supported at all: |
| 58 | + |
| 59 | +- **Features**: `Text indexes <https://www.mongodb.com/docs/manual/core/indexes/index-types/index-text/>`__, |
| 60 | + `2d indexes <https://www.mongodb.com/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index>`__, |
| 61 | + `hashed indexes <https://www.mongodb.com/docs/manual/core/indexes/index-types/index-hashed/#std-label-index-type-hashed>`__, |
| 62 | + `case-insensitive indexes <https://www.mongodb.com/docs/manual/core/index-case-insensitive/>`__, |
| 63 | + `sparse indexes <https://www.mongodb.com/docs/manual/core/index-sparse/>`__ |
| 64 | +- **Aggregation Stages**: ``$collStats``, ``$bucket``, ``$bucketAuto``, ``$currentOp``, |
| 65 | + ``$indexStats``, ``$listLocalSessions``, ``$listSessions``, ``$lookup`` |
| 66 | + |
| 67 | +To learn more about Azure Cosmos DB's compatibility with MongoDB v4.2, |
| 68 | +see Microsoft's `Azure Cosmos DB for MongoDB (4.2 server version): Supported features and syntax <https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/feature-support-42>`__ |
| 69 | +documentation. |
| 70 | + |
| 71 | +For the most current compatibility status between Azure Cosmos DB and MongoDB, see the |
| 72 | +`Is Cosmos DB Compatible with MongoDB Atlas? <https://www.iscosmosdbreallymongodb.com/>`__ |
| 73 | +website. |
| 74 | + |
| 75 | +Support |
| 76 | +------- |
| 77 | + |
| 78 | +MongoDB doesn't offer commercial support for Azure Cosmos DB. For help with this product, |
| 79 | +contact `Azure Support. <https://azure.microsoft.com/en-us/support/>`__ |
0 commit comments