Azure Cosmos DB: DocumentDB API

With the DocumentDB 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 DocumentDB API, and how you can use it to

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

    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

      1 comment  ·  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

      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

        1 comment  ·  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 →
        • Mark geography types as Serializable

          Currently geography types such as Microsoft.Azure.Documents.Spatial.Point are not marked as Serializable which prevents them, or classes containing them, from being passed as arguments to Service Fabric services. If possible, please mark them as Serializable.

          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 →
          • Upgrade the JavaScript engine to support ES6 in Stored procedures

            If I try to write a stored procedure using ES6 constructs such as let/const I now get errors:

            ------------------------------------------

            function() {

            const context = getContext();
            const collection = context.getCollection();
            ...
            }

            ------------------------------------------

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

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

              19 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

                2 comments  ·  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.

                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

                  0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                • Add DateTimeOffset support

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

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

                    51 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

                      2 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

                        0 comments  ·  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"
                        }
                        ],

                        19 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

                          2 comments  ·  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.

                          46 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 →
                          • Fix issue with linq criteria on child object

                            In a project i'm currently working on, we have come to realise that we should not use DocumentDb collections as if they are the equivalent of a table in f.ex SQL Server. As a result, we are now persisting all of the entities, belonging to a single tenant in a single collection.

                            We already have lots of linq queries in our codebase which assume that each document type (aggregate root) is persisted in a dedicated collection. In an attempt to make the transition painless, i set out to refactor our data access object, so that its api continues to reason…

                            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 →
                            • Allow Oder By Distance on spatial index

                              It is not currently possible to order results by distance to a point. This makes spatial querying quite limited

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

                                22 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 →
                                • DocumentDB driver/package for R

                                  There is one for MySQL. Not sure how hard it would be to build one for 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

                                    1 comment  ·  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.

                                    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

                                      1 comment  ·  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');

                                      12 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

                                        3 comments  ·  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.

                                        17 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 →
                                        • Consistency options for queries

                                          It would be nice to control whether queries hit the master or secondary partitions. It would also be nice to control this behavior with respect to continuation tokens and session keys.

                                          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 →
                                          ← Previous 1
                                          • Don't see your idea?

                                          Azure Cosmos DB: DocumentDB API

                                          Feedback and Knowledge Base