We’re excited to announce the preview of the Data API for vCore-based Azure Cosmos DB for MongoDB. The Data API provides a flexible and powerful way to interact with your database through HTTP-based API calls.
What is the Data API
The Data API for vCore-based Azure Cosmos DB for MongoDB allows you work with your MongoDB data through simple HTTP requests, eliminating the need for traditional drivers or complex queries. It offers an easy way to perform basic operations like creating, reading, updating, and deleting data directly from your applications. This simplifies connecting your MongoDB data to web apps, mobile apps, or tools like Power BI, all through a familiar and user-friendly API.
Example
To read active products from a products collection:
curl --user "username:password" https://c.dataapi-validation.mongocluster.cosmos.azure.com:10331/data/v1/action/aggregate -H "Content-Type: application/ejson" -H "Accept: application/ejson" -d "{\"database\": \"myDatabase\",\"collection\": \"products\",\"pipeline\": [{\"$match\":{ \"status\": \"active\" }}]}"
This retrieves all documents from the products collection where status is active, using a straightforward HTTP request.
Why the Data API Matters
The Data API simplifies interactions with Azure Cosmos DB for MongoDB by providing a direct HTTP-based method to access and manipulate data. This feature is crucial for developers who prefer RESTful APIs over traditional database drivers. vCore-based Azure Cosmos DB for MongoDB’s Data API can be authenticated with the same MongoDB users used to access the database through the MongoDB drivers. The same roles and permissions are applicable to both the Data API HTTPS endpoint and the MongoDB TCP endpoint.
Supporting you no matter which version you choose
Azure Cosmos DB for MongoDB is committed to supporting a wide range of MongoDB versions to meet your needs. Our single codebase approach ensures seamless, near-instant upgrades across versions.
- vCore Architecture: Supports MongoDB 5.0, 6.0, and 7,0.
- RU Architecture: Supports versions as far back as MongoDB 3.2 all the way to 7.0
How to Get Started
Please fill out the form to request access to the preview.
About Azure Cosmos DB
Azure Cosmos DB is a fully managed and serverless distributed database for modern app development, with SLA-backed speed and availability, automatic and instant scalability, and support for open-source PostgreSQL, MongoDB, and Apache Cassandra. Try Azure Cosmos DB for free here. To stay in the loop on Azure Cosmos DB updates, follow us on X, YouTube, and LinkedIn.
Is this announcement purely coincidental a few days after Atlas announced that it would deprecate the Data API? 😉