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. Allow multi Order By

    From what I see it is impossible to run a query with more than one column in the Order By.

    436 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      8 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
    • Support ORDER BY on the ST_DISTANCE spatial function

      Ordering results by the ST_DISTANCE spatial function is currently not supported.

      224 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        11 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
      • Cosmos DB BulkExecutor for .NET Core

        I would like Azure Cosmos DB BulkExecutor library for .NET Core compatible version.

        Recent application often uses Microsoft.Azure.DocumentDB.Core package, so the need for the .NET Core version is high.

        199 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          5 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
        • Support sub-query functions like EXISTS, NOT EXISTS

          It would be great to query within document array's without having to join them in the root's FROM-clause.
          (And likely, this also the creates the possibility to implement LINQ support for Any() and All())
          example:
          SELECT author
          FROM author
          WHERE EXISTS
          (SELECT b
          FROM author.Books b
          WHERE b.YearOfPublishing < 1980)

          Although there are workarounds they all have nasty side effects:
          1: In the following example the join results in non-unique results due to multiple books published before 1980 within single author-document:
          SELECT author
          FROM author
          JOIN b IN author.Books
          WHERE b.YearOfPublishing < 1980

          2: In the following example a UDF…

          179 votes
          Vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            Signed in as (Sign out)
            You have left! (?) (thinking…)
            2 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
          • Support LINQ ANY or WHERE for child object collections

            Example trying to query Sales

            var querySales = DocumentDb.Client.CreateDocumentQuery<Sale>(collectionLink)
            .Where(q => q.Type == "Sale" && q.Stage <= 99 && q.InvolvedParties.Any(qq => qq.Id == userId))

            Buy ANY not supported

            Also tried
            .Where(q => q.Type == "Sale" && q.Stage <= 99 && q.InvolvedParties.Where(qq => qq.Id == advisorUserId).Count() > 0)

            get WHERE not supported

            Really want the DB to perform the search as a lot of results will come back.

            sample data:
            {
            "id": "af10eebf-b0b6-49d5-8db5-96f54c4985d2",
            "Type": "Sale",
            "GroupId": 1,
            "InvolvedParties": [
            {
            "Id": "344595a3-4e73-4bd5-9988-849858f045f1",
            "PartyType": 0,
            "Name": "test user"
            }
            ],

            104 votes
            Vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              Signed in as (Sign out)
              You have left! (?) (thinking…)
              3 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
            • Native support for sub-query projections

              Support for sub-query projections like,

              SELECT food.id,
              food.description,
              food.tags,
              (SELECT food.servings.description FROM food.servings) AS SimpleServings
              FROM food

              55 votes
              Vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                Signed in as (Sign out)
                You have left! (?) (thinking…)
                1 comment  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
              • DocumentDB auto scale

                Please provide auto scale option in DocumentDB for scaling down and scale up of collection based on RU running.

                53 votes
                Vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  Signed in as (Sign out)
                  You have left! (?) (thinking…)
                  2 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                • Support ordering by multiple properties

                  As per the DocumentDB SQL Syntax docs:

                  "While the query grammar supports multiple order by properties, the DocumentDB query runtime supports sorting only against a single property..."

                  It would be great if this limitation was removed.

                  Thanks!

                  51 votes
                  Vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    Signed in as (Sign out)
                    You have left! (?) (thinking…)
                    1 comment  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                  • .NET SDK support in UWP apps

                    The following message is generated if one attempts to add the Microsoft.Azure.DocumentDb nuget package to a Universal Windows Platform app:
                    Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot).

                    51 votes
                    Vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      Signed in as (Sign out)
                      You have left! (?) (thinking…)
                      0 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                    • Permit executing a stored procedure from another stored procedure

                      function () {

                      var context = getContext();
                      var collection = context.getCollection();

                      collection.executeStoredProcedure('foo', {}, function (error, result){});

                      }

                      45 votes
                      Vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        Signed in as (Sign out)
                        You have left! (?) (thinking…)
                        1 comment  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                      • Deploy Stored Procedures from Source Control

                        It would be great if we could deploy sprocs from visualstudio.com as we can with Azure Functions or Azure Web Sites.

                        45 votes
                        Vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          Signed in as (Sign out)
                          You have left! (?) (thinking…)
                          3 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                        • stored procedures & functions in .NET (C#)

                          Would be great to have the option to implement stored procedures, functions and triggers in .NET (C#) as well.

                          43 votes
                          Vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            Signed in as (Sign out)
                            You have left! (?) (thinking…)
                            2 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                          • Order By Null Handling

                            Currently if you do an order by on a nullable value, the documents are not returned at all. Please add functionality similiar to Application Insights where you can specify if the documents with the null value appear at the beginning or end of the sort.

                            40 votes
                            Vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              Signed in as (Sign out)
                              You have left! (?) (thinking…)
                              1 comment  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                            • Support multiple collections in stored procedures

                              Currently CosmosDB Stored procedures only allow access to a SINGLE collection (because they seem to be scoped to collections rather than to the database), via getContext() :

                              var collection = getContext().getCollection();

                              But any "useful" / "real-life" application using ComosDB will typically have to interact with more than one collection. For example, it is currently IMPOSSIBLE to insert documents into two distinct collections within a database using a single stored procedure -- a VERY SERIOUS drawback / limitation.

                              I would propose that stored procedures be scoped to the database level and then we would be allowed to do something like:

                              var…

                              37 votes
                              Vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                Signed in as (Sign out)
                                You have left! (?) (thinking…)
                                0 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                              • The ability to reference JavaScript libraries (e.g. underscore) within server-side scripting

                                It'd be nice to be able to reference javascript libraries within server-side scripting. Something like an AMD or RequireJS loader.

                                For example:
                                var _ = require('lodash');

                                33 votes
                                Vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  Signed in as (Sign out)
                                  You have left! (?) (thinking…)
                                  4 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                                • Use Json.Net contract resolver when using Linq to generate SQL queries

                                  Member names in SQL queries generated from Linq currently look at the member for either a JsonPropertyAttribute or DataMemberAttribute. If the ability to specify custom JsonSerializerSettings is implemented (see http://feedback.azure.com/forums/263030-documentdb/suggestions/6422364-allow-me-to-set-jsonserializersettings ), this will need to be implemented to actually remove the need to annotate every member of your data object classes.

                                  28 votes
                                  Vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    Signed in as (Sign out)
                                    You have left! (?) (thinking…)
                                    1 comment  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Support the LIKE clause / regex expressions in the queries.

                                    Support the LIKE clause / regex expressions in the queries.
                                    Sample
                                    --SQL
                                    SELECT *
                                    FROM THINGS
                                    WHERE serialNumber LIKE '%A0000%'

                                    27 votes
                                    Vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      Signed in as (Sign out)
                                      You have left! (?) (thinking…)
                                      2 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                                    • 25 votes
                                      Vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        Signed in as (Sign out)
                                        You have left! (?) (thinking…)
                                        2 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Add DateTimeOffset support

                                        The DocumentDb engine should be able to recognize and properly order DateTimeOffset serialized fields.

                                        21 votes
                                        Vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          Signed in as (Sign out)
                                          You have left! (?) (thinking…)
                                          1 comment  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Add built-in cast function for SQL queries

                                          Need built-in function for casting string datatypes to INT, NUMBER, DOUBLE, etc. in SQL queries as our data loader is converting the number to string during document creation. We have a requirement to filter on numeric values in our application.

                                          19 votes
                                          Vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            Signed in as (Sign out)
                                            You have left! (?) (thinking…)
                                            0 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
                                          ← Previous 1 3
                                          • Don't see your idea?

                                          Azure Cosmos DB

                                          Feedback and Knowledge Base