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

    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 →
    • Make GridFS just work

      To make it easy to migrate to Cosmos DB, as well as for the scenario to support both MongoDB and Cosmos DB, it is better to make the GridFS API just work.

      see:
      https://stackoverflow.com/questions/43901158/gridfs-support-in-mongoapi-of-azure-documentdb

      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 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 →
        • Aggregation Pipeline

          Need support for MongoDB's aggregation pipeline

          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 →
          • 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...

            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 →

              Thank you for bringing this to our attention. We are investigating the issue and we will give you an update as soon as possible. In the meantime, please remove the “replicaSet=globalDB” from your connection string and options. Apologies for the inconvenience.

              Thanks,
              Andrew Hoh
              Azure Cosmos DB

            • 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 →
              • The partition key field disappeared while creatiing new outputstream with mongo as sink from stream analytics

                I created one collection in Mongo with 400 RU, unpartitioned. Two days back while adding mongoDB collections to output stream of stream analytics as data sink, it was showing one field "partition key" after "collection" & "Document Id". But yesterday I observed that "partition key"field is disappeared & stream jobs are failing by shouting the error that it needs valid partition key.... Confused.

                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 →
                • Prices

                  DocumentDB price is prohibitive for mobile applications with a database and several collections.
                  This makes it very expensive to use more than one collection for app.
                  The solution to this is to have only one database and a collection where all documents are stored, but this does not happen if we use mongo db, where the price per GB is hired, no matter the number of databases or collections.

                  9 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

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

                  Azure Cosmos DB: MongoDB API

                  Feedback and Knowledge Base