Skip to content

Commit 1c8a2e6

Browse files
authored
Update how-to-create-indexes.md
Fixed MS author alias typo
1 parent f571e5a commit 1c8a2e6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

articles/cosmos-db/mongodb/vcore/how-to-create-indexes.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Indexing Best Practices in Azure Cosmos DB for MongoDB vCore
33
titleSuffix: Azure Cosmos DB for MongoDB vCore
44
description: Use create Indexing for empty collections in Azure Cosmos DB for MongoDB vCore.
55
author: abinav2307
6-
ms.author: abrameesh
6+
ms.author: abramees
77
ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: mongodb-vcore
@@ -46,9 +46,14 @@ If the createIndex commands are being issued through the Mongo Shell, use Ctrl +
4646
Using Ctrl + C to interrupt the createIndex command after it has been issued does not terminate the index build operation on the server. It simply stops the Shell from waiting on a response from the server, while the server asynchronously continues to build the index over the existing documents.
4747

4848
## Create Compound Indexes for queries with predicates on multiple fields
49-
Compound indexes should be used for the following scenarios:
50-
- Queries with filters on multiple fields
51-
- Queries with filters on multiple fields and with one or more fields sorted in ascending or descending order
49+
Compound indexes should be used in the following scenarios:
50+
- Queries with filters on any field in the JSON structure making it easier to use wildcard indexing instead of indexing each field individually.
51+
- Queries with filters on all but a few fields making it is easier to exclude a few fields instead of indexing most of the fields individually.
52+
53+
Wildcard indexing will soon be available in Azure Cosmos DB for MongoDB vCore. Until then, this sample provides a workaround to circumvent creating individual indexes. The solution takes a sample json file and performs the following actions:
54+
- Iterates through each root level field and creates an index on the field.
55+
- Iterates through each nested field and creates an index in the field after concatenating the path to the nested field.
56+
- Handles Objects, Arrays and base field types accordingly
5257

5358
Consider the following document within the 'cosmicworks' database and 'employee' collection
5459
```json

0 commit comments

Comments
 (0)