Skip to content

Commit fab4c21

Browse files
committed
fixing another indentation issue
1 parent 40baba7 commit fab4c21

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

articles/cosmos-db/mongodb/vcore/indexing.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ db.products.find({"launchDate": {$gt: ISODate("2024-06-01T00:00:00.000Z")}})
8989

9090
Compounded indexes on nested fields aren't supported by default due to limitations with arrays. If your nested field doesn't contain an array, the index works as intended. If your nested field contains an array (anywhere on the path), that value is ignored in the index.
9191

92-
As an example, a compound index containing `people.dylan.age` works in this case since there's no array on the path:
92+
As an example, a compound index containing `author.lastName` works in this case since there's no array on the path:
9393

9494
```json
9595
{
@@ -155,14 +155,14 @@ Text indexes in Azure Cosmos DB for MongoDB vcore come with several options to c
155155

156156
- Create an index to support search on both the `title` and `content` fields with English language support. Also, assign higher weights to the `title` field to prioritize it in search results.
157157

158-
```javascript
159-
use cosmicworks
158+
```javascript
159+
use cosmicworks
160160

161-
db.products.createIndex(
162-
{ title: "text", content: "text" },
163-
{ default_language: "english", weights: { title: 10, content: 5 }, caseSensitive: false }
164-
)
165-
```
161+
db.products.createIndex(
162+
{ title: "text", content: "text" },
163+
{ default_language: "english", weights: { title: 10, content: 5 }, caseSensitive: false }
164+
)
165+
```
166166

167167
> [!NOTE]
168168
> When a client performs a text search query with the term "Cosmos DB," the score for each document in the collection will be calculated based on the presence and frequency of the term in both the "title" and "content" fields, with higher importance given to the "title" field due to its higher weight.
@@ -275,7 +275,7 @@ db.places.createIndex({ "location": "2dsphere"});
275275
- Polygons with holes don't work. Inserting a Polygon with hole isn't restricted though `$geoWithin` query fails for scenarios:
276276
1. If the query itself has polygon with holes.
277277

278-
```javascript
278+
```javascript
279279
coll.find(
280280
{
281281
"b": {
@@ -295,13 +295,13 @@ db.places.createIndex({ "location": "2dsphere"});
295295
}
296296
})
297297
298-
// MongoServerError: $geoWithin currently doesn't support polygons with holes
299-
```
298+
// MongoServerError: $geoWithin currently doesn't support polygons with holes
299+
```
300300

301301
2. If there's any unfiltered document that has polygon with holes.
302302
303-
```javascript
304-
[mongos] test> coll.find()
303+
```javascript
304+
[mongos] test> coll.find()
305305
[
306306
{
307307
_id: ObjectId("667bf7560b4f1a5a5d71effa"),
@@ -314,17 +314,16 @@ db.places.createIndex({ "location": "2dsphere"});
314314
}
315315
}
316316
]
317-
318-
// MongoServerError: $geoWithin currently doesn't support polygons with holes
319-
```
317+
// MongoServerError: $geoWithin currently doesn't support polygons with holes
318+
```
320319
321320
3. `key` field is mandatory while using `geoNear`.
322321
323-
```javascript
322+
```javascript
324323
[mongos] test> coll.aggregate([{ $geoNear: { $near: { "type": "Point", coordinates: [0, 0] } } }])
325324

326325
// MongoServerError: $geoNear requires a 'key' option as a String
327-
```
326+
```
328327
329328
## Next steps
330329

0 commit comments

Comments
 (0)