You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/mongodb-indexing.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Manage indexing in the Azure Cosmos DB API for MongoDB
2
+
title: Manage indexing in Azure Cosmos DB's API for MongoDB
3
3
description: This article presents an overview of Azure Cosmos DB indexing capabilities by using the MongoDB API.
4
4
ms.service: cosmos-db
5
5
ms.subservice: cosmosdb-mongo
@@ -12,29 +12,29 @@ ms.author: tisande
12
12
---
13
13
# Manage indexing in the Azure Cosmos DB API for MongoDB
14
14
15
-
The Azure Cosmos DB API for MongoDB takes advantage of the core index-management capabilities of Azure Cosmos DB. This article focuses on how to add indexes by using the Azure Cosmos DB API for MongoDB. You can also read an [overview of indexing in Azure Cosmos DB](index-overview.md) that's relevant across all APIs.
15
+
Azure Cosmos DB's API for MongoDB takes advantage of the core index-management capabilities of Azure Cosmos DB. This article focuses on how to add indexes using Azure Cosmos DB's API for MongoDB. You can also read an [overview of indexing in Azure Cosmos DB](index-overview.md) that's relevant across all APIs.
16
16
17
17
## Indexing for MongoDB server version 3.6
18
18
19
-
The Azure Cosmos DB API for MongoDB version 3.6 automatically indexes the `_id` field, which can't be dropped. It automatically enforces the uniqueness of the `_id` field per shard key.
19
+
Azure Cosmos DB's API for MongoDB server version 3.6 automatically indexes the `_id` field, which can't be dropped. It automatically enforces the uniqueness of the `_id` field per shard key.
20
20
21
-
To index additional fields, you apply the MongoDB index-management commands. As in MongoDB, the Azure Cosmos DB API for MongoDB automatically indexes the `_id` field only. This default indexing policy differs from the Azure Cosmos DB SQL API, which indexes all fields by default.
21
+
To index additional fields, you apply the MongoDB index-management commands. As in MongoDB, Azure Cosmos DB's API for MongoDB automatically indexes the `_id` field only. This default indexing policy differs from the Azure Cosmos DB SQL API, which indexes all fields by default.
22
22
23
23
To apply a sort to a query, you must create an index on the fields used in the sort operation.
24
24
25
25
## Index types
26
26
27
27
### Single field
28
28
29
-
You can create indexes on any single field. The sort order of the single-field index does not matter. The following command creates an index on the field `name`:
29
+
You can create indexes on any single field. The sort order of the singlefield index does not matter. The following command creates an index on the field `name`:
30
30
31
31
`db.coll.createIndex({name:1})`
32
32
33
-
One query uses multiple single-field indexes where available. You can create up to 500 single-field indexes per container.
33
+
One query uses multiple singlefield indexes where available. You can create up to 500 singlefield indexes per container.
34
34
35
35
### Compound indexes (MongoDB server version 3.6)
36
36
37
-
The Azure Cosmos DB API for MongoDB supports compound indexes for accounts that use the version 3.6 wire protocol. You can include up to eight fields in a compound index. Unlike in MongoDB, you should create a compound index only if your query needs to sort efficiently on multiple fields at once. For queries with multiple filters that don't need to sort, create multiple single-field indexes instead of a single compound index.
37
+
Azure Cosmos DB's API for MongoDB supports compound indexes for accounts that use the version 3.6 wire protocol. You can include up to eight fields in a compound index. Unlike in MongoDB, you should create a compound index only if your query needs to sort efficiently on multiple fields at once. For queries with multiple filters that don't need to sort, create multiple singlefield indexes instead of a single compound index.
38
38
39
39
The following command creates a compound index on the fields `name` and `age`:
40
40
@@ -66,7 +66,7 @@ Here's an example of creating a geospatial index on the `location` field:
66
66
67
67
### Text indexes
68
68
69
-
The Azure Cosmos DB API for MongoDB does not currently support text indexes. For text search queries on strings, you should use [Azure Cognitive Search](https://docs.microsoft.com/azure/search/search-howto-index-cosmosdb) integration with Azure Cosmos DB.
69
+
Azure Cosmos DB's API for MongoDB does not currently support text indexes. For text search queries on strings, you should use [Azure Cognitive Search](https://docs.microsoft.com/azure/search/search-howto-index-cosmosdb) integration with Azure Cosmos DB.
70
70
71
71
## Index properties
72
72
@@ -134,7 +134,7 @@ The preceding command deletes any documents in the ```db.coll``` collection that
134
134
135
135
## Track index progress
136
136
137
-
Version 3.6 of the Azure Cosmos DB API for MongoDB supports the `currentOp()` command to track index progress on a database instance. This command returns a document that contains information about in-progress operations on a database instance. You use the `currentOp` command to track all in-progress operations in native MongoDB. In the Azure Cosmos DB API for MongoDB, this command only supports tracking the index operation.
137
+
Version 3.6 of Azure Cosmos DB's API forMongoDB supports the `currentOp()` command to track index progress on a database instance. This command returns a document that contains information about in-progress operations on a database instance. You use the `currentOp` command to track all in-progress operationsin native MongoDB. In Azure Cosmos DB's API for MongoDB, this command only supports tracking the index operation.
138
138
139
139
Here are some examples that show how to use the `currentOp` command to track index progress:
140
140
@@ -235,7 +235,7 @@ If you're using version 3.2, this section outlines key differences with version
235
235
236
236
### Dropping default indexes (version 3.2)
237
237
238
-
Unlike the 3.6 version of the Azure Cosmos DB API for MongoDB, version 3.2 indexes every property by default. You can use the following command to drop these default indexes for a collection (```coll```):
238
+
Unlike the 3.6 version of Azure Cosmos DB's API for MongoDB, version 3.2 indexes every property by default. You can use the following command to drop these default indexes for a collection (```coll```):
0 commit comments