Deepcoder
Deepcoder

Reputation: 33

Count and data in single query in Azure Cosmos DB

I want to return the count and data by writing it in a single Cosmos sql query.

Something like

Select *, count() from c

Or if possible i want get the count in a json document.

[
    {
        "Count" : 1111
    },
    {
        "Name": "Jon",
        "Age" : 30
    }
]

Upvotes: 2

Views: 1242

Answers (1)

Rob Reagan
Rob Reagan

Reputation: 7696

You're going to have to issue two separate queries - one to get the total number of documents matching your query, and a second to get a page of documents.

Upvotes: 1

Related Questions