Azure Cosmos DB

Azure Cosmos DB is a globally distributed database service designed to enable you to elastically and independently scale throughput and storage across any number of geographical regions with comprehensive SLAs. You can develop document, key/value, or graph databases with Cosmos DB using a series of popular APIs and programming models.

SQL API:
With the SQL API, Azure Cosmos DB provides rich and familiar SQL query capabilities with consistent low latencies over schema-less JSON data. In this article, we provide an overview of the Azure Cosmos DB’s SQL API, and how to best use the API.

Gremlin API:
Azure Cosmos DB provides the Gremlin API for graph modeling and traversal, along with turn-key global distribution, elastic scaling of storage and throughput, and low latency.

Cassandra API
Azure Cosmos DB supports the Cassandra API. This means that by using existing drivers, your application written for Cassandra can now communicate with Azure Cosmos DB instead of Apache Cassandra/Datastax Enterprise databases, and gain benefits like global distribution and elastic scale.

MongoDB API:
Azure Cosmos DB supports the MongoDB API. This means that by using existing drivers, your application written for MongoDB can now communicate with Cosmos DB instead of MongoDB databases, and gain benefits like global distribution & elastic scale.

Table API:
Azure Cosmos DB provides the Table API for key-value workloads. This provides a premium experience for Azure Table storage with secondary indexes, global distribution, low latency, and dedicated throughput.

How can we improve Azure Cosmos DB?

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Add Change Feed support to MongoDB API

    Presently leveraging Azure Functions via Cosmos Change Feed is not an option if you use the MongoDB API. Any immediate plans to implement this?

    172 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  2. Support for transactions via Mongo 4.0 API

    Mongo 4.0 incl transactions has been released: https://www.mongodb.com/transactions.
    CosmosDB should support Mongo 4.0 API (including transactions)

    160 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    7 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  3. Better handling of "request limit too large"

    Here (https://docs.microsoft.com/en-us/azure/cosmos-db/performance-tips) you can see that when you have exceeded your RU/s quota, Cosmos DB will respond with HTTP Status 429 with an HTTP header x-ms-retry-after-ms telling you when you can make the next request. It also says that the request will be retried automatically, if you use the SQL API.

    For the MongoDB API, requests will not be retried automatically and there is nothing telling the user how long to wait before retrying. Instead you have to catch a MongoCommandException, look at the Code property for 16500 and guess when to retry,

    I'd like the same support…

    153 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  4. Mongo DB API - cursor.sort() does not return sorted result

    When I use find() with sort(), the results are not sorted correctly. The order of the returned items do change, but in a strange order. (MongoDB returns correctly sorted result with the same query). Is this a CosmosDB bug?

    Here are the queries and results. The queries are executed with a Mongo DB shell connected to a Cosmos DB instance. You can see that the header_timestamp order are incorrect.

    > db.datastore.find({}, {_id: 1, header_timestamp: 1})

    { "_id" : "object-bbfg0pritvunrk0bi170", "header_timestamp" : NumberLong(1) }
    { "_id" : "object-bbfg0rjitvunrk0bi180", "header_timestamp" : NumberLong(3) }
    { "_id" : "object-bbfg0s3itvunrk0bi18g", "header_timestamp" : NumberLong(4) }
    {…

    96 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  5. Add support for "Search text" ($text Operator)

    Support for "Mongo Search Text" (https://docs.mongodb.com/manual/text-search/). Example of use:

    db.stores.find( { $text: { $search: "java coffee shop" } } )

    77 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  6. Needs documentation about limits when MongoDb API is used

    Seems that information about limitations with MongoDb API is missing,
    or impossible to find. For example mongo has max doc size 16Mb but
    Azure docDb 2Mb, which is correct for CosmosDbWithMongoAPI.
    (Even that documentDb limits documentation which is referred in this site seems to be removed)

    -Maximum document size ?
    -Maximum query payload size ?
    -Maximum query result size ?
    -Maximum size of partition of partitioned collection ?
    -Maximum count of documents in the partition of partitioned collection ?
    -Maximum count of documents in single-partition collection ?
    -MongoDb needs manual creation of indexes, docDb indexes automatically all properties, how about…

    77 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  7. MongoDB API : aggregation operation is too slow

    the aggregation operation is too slow ...

    57 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    9 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →

    We are currently working on this feature and have made it available in Preview in the Azure Portal.

    Please feel free to test Aggregation Pipeline support for your MongoDB API accounts in Cosmos DB by opening your MongoDB API account, then clicking on “Preview” tab on left hand side and then Enable for Aggregation Pipeline.

    While there please feel free to test support for MongoDB 3.4 support as well as Per-Document TTL support.

    Thank you for your request and votes.

  8. Support for document validation, using JSON Schema

    Similar to MongoDB v3.6 https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/ Would be useful for both MongoDB API and DocumentDB API

    50 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  9. Azure Cosmos DB doesn't support basic sort

    Mongo supports case insensitive sort through collation usage.
    When I tested on mongo locally it worked, when deployed on azure platform it just started throwing error:
    "MongoError: server bmcldocdb.documents.azure.com:10255 does not support collation"

    46 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  10. Support $geonear query in Azure Cosmos DB Mongo API

    I want to transition my application to use Azure Cosmos DB. It is currently using MongoDB with the latest Mongo C# Driver.

    Most of the functionality is working with just updating the connection string to point to the Azure Cosmos DB.

    However some of the major functionality in my application makes use of MongoDB geonear functionality with code as below:

    public IEnumerable<Tuple<Location, double>> GeoNear(StagedLocation stagedLocation, int matchRadius)
    {
    var geoPoint = new BsonDocument
    {
    {"type","Point"},
    {"coordinates",new BsonArray(new []{ stagedLocation.Address.Longitude.Value, stagedLocation.Address.Latitude.Value })}
    };

    var geoNearOptions = new BsonDocument
    {
    {"near", geoPoint},
    {"spherical", true },
    {"limit", 20},
    {"distanceField", "Distance"},
    {"maxDistance", Convert.ToDouble(matchRadius)},
    };

    42 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  11. Support $GraphLookup

    $graphLookup is not implemented in Mongo API
    If you try to do this with Mongo API (or Cosmos DB) + Gremlin you need to know what the relationships are upfront. Need DYNAMIC joins 
    which MongoDB supports today.

    38 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  12. CosmosDB, Mongo API, Delete Many with Partition Key configured

    We have an IoT based solution and archive old data to blob storage. Our data is moved to archive using the shard key. Removing the data once archived is a pain and slow as each individual document has to be deleted rather than using DeleteMany(x=>x.shardId == id).

    More info found at:
    https://stackoverflow.com/questions/51301711/cosmosdb-mongo-api-delete-many-with-partition-key-configured

    37 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  13. 33 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  14. Add support for latest $lookup step in aggregation pipeline

    In v3.6 of Mongo, the $lookup step of an aggregation pipeline added the ability to join on conditions instead of just an exact match. This is thoroughly documented in the official documentation.

    https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/index.html#join-conditions-and-uncorrelated-sub-queries

    When I attempt to use the step in CosmosDB, I receive the error "Unrecognized parameter to $lookup: let" which indicates that the latest API is not yet supported.

    24 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  15. Support TTL indexes on any field

    Please add support for TTL indexes on any field, not just the internal and inaccessible `_ts` field. We need document specific TTLs.

    https://docs.mongodb.com/manual/tutorial/expire-data/

    24 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →

    Per document TTL is now available in Preview for customers to try.

    To enable and test this feature access your MongoDB API account for Cosmos DB in the Azure Portal, click Preview tab on left hand side, then click Enable to test Per-document TTL.

    You will can also enable and try Aggregation Pipeline and MongoDB 3.4 support from here as well.

    Please try TTL and all these features and please feel free to give us feedback.

    Thank you for your suggestion and your votes.

  16. Please remove the 40MB limit, when migrate whole Cosmos DB's data.

    When I migrate whole Cosmos Mongo DB's data to external MongoDB, below error is occurred.

    [Error Mesaage]
    Query exceeded the maximum allowed memory usage of 40 MB. Please consider adding more filters to reduce the query response size.

    So, Could you remove the 40MB limit, when migrate whole Cosmos DB's data?

    21 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  17. 16 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  18. Support MongoDB's $expr operation

    MongoDB's '$expr' operation (https://docs.mongodb.com/manual/reference/operator/query/expr/#op._S_expr) seems to be unsupported. When including '$expr' in a query it seems to be treated as a regular field name.
    This limits the usability of Cosmos as a drop-in replacement for MongoDB when these queries are needed.

    16 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  19. Azure mongodb timeout after 30 mins

    Currently azure closes mongodb connection after 30 mins and doesn't inform the webapp. So after 30 mins app uses same connection it gets error.
    See details in

    https://stackoverflow.com/questions/48464455/connection-to-cosmosdb-through-mongo-api-fails-after-idle

    Any plan to fix this or work around ?

    13 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  20. partialFilterExpression should be supported

    According to MongoDB documentation, partialFilterExpression is supported since version 3.2: https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/

    When querying Azure Cosmos DB server version I receive "3.2.0" so I am expecting partialFilterExpression to be supported.

    Unfortunately I receive: 'partialFilterExpression' is not supported when trying to create an index using partialFilterExpression.

    I have several remarks here:

    1) Can you provide an exhaustive documentation on features that are implemented and those that are not?
    2) Can you please advertise that you do not support MongoDB API entirely?
    3) Is there a way to track current backlog and status of Mongo DB API implementation at Microsoft? Transparency is the…

    13 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: oidc
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
← Previous 1
  • Don't see your idea?

Azure Cosmos DB

Feedback and Knowledge Base