Azure Cosmos DB: 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.

(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.

  1. Pull filter with In/Contains

    Want to remove items from HomeTimeline which exist in another list (unfollowedUserHomeTimelineIds) while I update the User object with a couple of more things.

    var update = Builders<User>.Update
    .Inc(u => u.FollowingCount, -1)
    .PullFilter(p => p.Following, f => f.Id == unfollowedUserObjectId)
    .PullFilter(p => p.HomeTimeline, Builders<Reference>.Filter.In(r => r.Id, unfollowedUserHomeTimelineIds));
    var result = Users.UpdateOneAsync(p => p.Id == myUserObjectId, update).Result;
    the above is resulting in:

    MongoCommandException: Command update failed: Operator ''OPERATOR_PULL' with condition' is not supported.

    1 vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)

      We’ll send you updates on this idea

      0 comments  ·  Flag idea as inappropriate…  ·  Admin →
    • Support UUID subtype 4

      UUID subtype 4 is currently not supported at CosmosDB. Trying to insert them I got the follow message error:

      'Request is malformated. The GuidRepresentation for the reader is CSharpLegacy, which requires the binary sub type to be UuidLegacy, not UuidStandard.'

      The subtype 4 is very important to keep compatibility between different platforms and languages as we know, so I believe it's worth to implement it.

      2 votes
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)

        We’ll send you updates on this idea

        1 comment  ·  Flag idea as inappropriate…  ·  Admin →
      • Add $elementMatch support in projections

        Currently Document DB fails to execute queries that have an $elementMatch in the projection fields.

        It´s usefull to reduce the amount of traffic in large arrays and it's of course supported in MongoDB. Until this is done, it would be nice if the DB reports unsupported (like with other un suported features) instead of an incorrect "Syntax error". It´s confusing and takes time to debug against a real Mongodb instance.

        Jose Luis Pedrosa

        6 votes
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)

          We’ll send you updates on this idea

          0 comments  ·  Flag idea as inappropriate…  ·  Admin →
        • Allow for random sample

          It would be great if mongodb's $sample (https://docs.mongodb.com/manual/reference/operator/aggregation/sample/) worked in Cosmos DB--it is not currently supported and I don't know any other way to find a random sample of N documents.

          1 vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)

            We’ll send you updates on this idea

            0 comments  ·  Flag idea as inappropriate…  ·  Admin →
          • 6 votes
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)

              We’ll send you updates on this idea

              1 comment  ·  Flag idea as inappropriate…  ·  Admin →
            • Unique indexes on field in collection

              At this moment it is not possible to create unique indexes on a field in a collection (which is not a primary key).

              Through the Mongo Db driver, I can use the "CreateIndex" method without any problem, it returns "Ok", but the index never appears in MongoChef or RoboMongo to be applied on the collection.

              It would be nice to have unique index capacities in MongoDb through Azure Cosmos Db

              2 votes
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)

                We’ll send you updates on this idea

                0 comments  ·  Flag idea as inappropriate…  ·  Admin →
              • 2 votes
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)

                  We’ll send you updates on this idea

                  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
                • Executing mongodb-scripts

                  Our database can be migrated (cases: adding fields, removing fields, ...) at this moment using the Mongo driver (C#) and some data migration plugins. Is there an easier way to transform/migrate data through scripting?

                  It should be good to have scripting tools to execute more than one mongodb-statement at the same time. What can you suggest at this moment?

                  1 vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)

                    We’ll send you updates on this idea

                    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                  • Joining documents in multiple collections

                    I would like to join a document to related documents in another collection (which are not embedded in same collection) in 1 roundtrip.

                    For example: Person has an address (and is stored seperately), or more complex to retrieve data for a relationship with three entities in separate linked collection.

                    It seems that $lookup is the solution, but it isn't supported yet through RoboMongo or Mongo driver.

                    Are there other solutions at this moment?

                    7 votes
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)

                      We’ll send you updates on this idea

                      0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                    • 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" } } )

                      4 votes
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)

                        We’ll send you updates on this idea

                        0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                      • support COUNT of a query on a partitioned collection

                        db.collection.count() works just find but when attempting to count a filtered down collection db.collection.find({query...}).count() results in an Operation Failure that says 'query in command must target a single shard key' but need to be able to do counts across multiple partitions

                        5 votes
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)

                          We’ll send you updates on this idea

                          1 comment  ·  Flag idea as inappropriate…  ·  Admin →
                        • Add support for ProjectDefinition and SortDefinition from MongoAPI to query DocumentDB

                          I am using following code (MongoDB C# driver) to projects fields , where queryDocument = '{{ "FullName" : /myname/i }}'

                          BsonDocument projectionDefination = Builders.Projection.ToBsonDocument();
                          projectionDefination.Add(new BsonElement("FullName", "myname"));
                          collection.Find(queryDocument).Project(projectionDefination);

                          getting following error:

                          {"Command failed."}

                          {{ "_t" : "OKMongoResponse", "ok" : 0, "code" : 9, "errmsg" : "Syntax error, incorrect syntax near '9'.", "$err" : "Syntax error, incorrect syntax near '9'." }}

                          Can anyone update on this?

                          I also tried above with RoboMongo

                          Command: db.getCollection('Employee').find({ "FullName": /User/i}).projection({ "FullName" : "$FullName" })

                          Received following error:

                          Error: error: { "_t" : "OKMongoResponse", "ok" : 0, "code" : 9, "errmsg" : "Syntax error, incorrect syntax…

                          1 vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)

                            We’ll send you updates on this idea

                            1 comment  ·  Flag idea as inappropriate…  ·  Admin →
                          • Azure CosmosDB is too expensive for small but multiple collections

                            Currently using on-prem MongoDB (on Linux) and wish to move to Azure, but I find CosmosDB is too expensive for small but multiple (MongoDB)collections because it seems that a minimum of 400 RRU's/per second will be charged for each collection.

                            The terminology used on the pricing web pages is somewhat unclear though and I am not sure if the pricing for the minimum of 400 RRU's/second applies to partitions or collection (or if these terms are in fact identical semantically)

                            20 votes
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)

                              We’ll send you updates on this idea

                              9 comments  ·  Flag idea as inappropriate…  ·  Admin →
                            • Aggregation Pipeline

                              Need support for MongoDB's aggregation pipeline

                              14 votes
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)

                                We’ll send you updates on this idea

                                0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                              • Fix bug that destroys nodejs mongodb connection pool every ~10s.

                                I have written a small express web app that uses a mongodb back end. As is standard practice, I create a single connection pool when the app starts and reuse it for the duration. This works great against a true mongodb back end. However, when I instead hook my app up to a CosmosDB back end, I get an error after about 10 seconds that says that my connection pool has been destroyed.

                                My current workaround is to just create a new connection every 9 seconds...

                                15 votes
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)

                                  We’ll send you updates on this idea

                                  5 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                • Sparse index support

                                  Are sparse indexes supported? I get a pymongo error when trying to create sparse indexes on collections.

                                  File "/usr/local/lib/python3.5/dist-packages/pymongo-3.4.0-py3.5-linux-x86_64.egg/pymongo/collection.py", line 1562, in ensure_index
                                  self.__create_index(keys, kwargs)
                                  File "/usr/local/lib/python3.5/dist-packages/pymongo-3.4.0-py3.5-linux-x86_64.egg/pymongo/collection.py", line 1430, in __create_index
                                  parse_write_concern_error=True)
                                  File "/usr/local/lib/python3.5/dist-packages/pymongo-3.4.0-py3.5-linux-x86_64.egg/pymongo/collection.py", line 232, in _command
                                  collation=collation)
                                  File "/usr/local/lib/python3.5/dist-packages/pymongo-3.4.0-py3.5-linux-x86_64.egg/pymongo/pool.py", line 419, in command
                                  collation=collation)
                                  File "/usr/local/lib/python3.5/dist-packages/pymongo-3.4.0-py3.5-linux-x86_64.egg/pymongo/network.py", line 116, in command
                                  parse_write_concern_error=parse_write_concern_error)
                                  File "/usr/local/lib/python3.5/dist-packages/pymongo-3.4.0-py3.5-linux-x86_64.egg/pymongo/helpers.py", line 210, in _check_command_response
                                  raise OperationFailure(msg % errmsg, code, response)
                                  pymongo.errors.OperationFailure: 'sparse' is not supported

                                  1 vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)

                                    We’ll send you updates on this idea

                                    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Do you support or plan to support querying of the replica sets?

                                    Do you support or plan to support querying of the replica sets? The scenario I'm thinking is the restore of partial data based on business logic. For instance, we might want to restore the data of a single customer, without touching the rest of the customers. If we can query a specific snapshot, we could merge those documents into the active account, those restoring the customer only data.

                                    1 vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)

                                      We’ll send you updates on this idea

                                      0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Don't see your idea?

                                    Azure Cosmos DB: MongoDB API

                                    Feedback and Knowledge Base