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/vcore/indexing.md
+37-37Lines changed: 37 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ This same compound index doesn't work in this case since there's an array in the
113
113
}
114
114
```
115
115
116
-
**Limitations**
116
+
### Limitations
117
117
118
118
- Maximum of 32 fields\paths within a compound index.
119
119
@@ -130,7 +130,7 @@ db.products.createIndex (
130
130
)
131
131
```
132
132
133
-
**Limitations**
133
+
### Limitations
134
134
135
135
- Partial indexes don't support `ORDER BY` or `UNIQUE` unless the filter qualifies.
136
136
@@ -173,26 +173,26 @@ Once the text index is created, you can perform text searches using the "text" o
173
173
174
174
- Perform a text search for the phrase `Cosmos DB`.
175
175
176
-
```javascript
177
-
use cosmicworks
176
+
```javascript
177
+
use cosmicworks
178
178
179
-
db.products.find(
180
-
{ $text: { $search:"Cosmos DB" } }
181
-
)
182
-
```
179
+
db.products.find(
180
+
{ $text: { $search:"Cosmos DB" } }
181
+
)
182
+
```
183
183
184
184
- Optionally, use the `$meta` projection operator along with the `textScore` field in a query to see the weight
185
185
186
-
```javascript
187
-
use cosmicworks
186
+
```javascript
187
+
use cosmicworks
188
188
189
-
db.products.find(
190
-
{ $text: { $search:"Cosmos DB" } },
191
-
{ score: { $meta:"textScore" } }
192
-
)
193
-
```
189
+
db.products.find(
190
+
{ $text: { $search: "Cosmos DB" } },
191
+
{ score: { $meta: "textScore" } }
192
+
)
193
+
```
194
194
195
-
**Limitations**
195
+
### Limitations
196
196
197
197
- Only one text index can be defined on a collection.
198
198
-Text indexes support simple text searches and don't yet provide advanced search capabilities like regular expressions.
@@ -216,7 +216,7 @@ Index on single field, indexes all paths beneath the `field` , excluding other f
216
216
217
217
Creating an index on { "pets.$**": 1 }, creates index on details & sub-document properties but doesn't create an index on “familyName”.
218
218
219
-
**Limitations**
219
+
### Limitations
220
220
221
221
- Wildcard indexes can't support unique indexes.
222
222
- Wildcard indexes don't support push downs of`ORDER BY` unless the filter includes only paths present in the wildcard (since they don't index undefined elements)
@@ -242,7 +242,7 @@ Use the `createIndex` method with the `2d` option to create a geospatial index o
242
242
db.places.createIndex({ "location": "2d"});
243
243
```
244
244
245
-
**Limitations**
245
+
### Limitations
246
246
247
247
- Only 1 location field can be part of the `2d` index and only 1 other non-geospatial field can be part of the `compound 2d` index
0 commit comments