QuestionQ60

VerifiedConnect to and consume Azure services

You are developing a new website page that uses Azure Cosmos DB for data storage. The feature uses documents in the following format:

Question Image

You must show data for the new page in a specified order. You create the following query for the page:

Question Image

You need to configure an Azure Cosmos DB policy that supports the query. Each JSON segment may be used once, more than once, or not at all.

Drag & Drop
{
    "automatic": true,
    "ngMode": "Consistent",
    "includedPaths": [
        {
            "path": "/*"
        }
    ], "excludedPaths": [ ],
    "": [
        [
            {
                "path": "/name", "order": "descending"
            },
            {
                "path": "/city", "order": ""
            }
        ]
    ]
}
Explanation

Azure Cosmos DB uses a composite index to support queries that sort by multiple properties. The composite index must list the properties in the ORDER BY sequence and use matching sort directions: /name ascending by default and /city descending.

Community Discussion

No comments yet. Be the first to start the discussion!