Skip to content

Commit 811dc12

Browse files
authored
Merge pull request #2573 from bagerard/improve_compound_indexes
Improve compound indexes in rst
2 parents dbd7228 + 4210ea0 commit 811dc12

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/guide/defining-documents.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ dictionary containing a full index definition.
477477

478478
A direction may be specified on fields by prefixing the field name with a
479479
**+** (for ascending) or a **-** sign (for descending). Note that direction
480-
only matters on multi-field indexes. Text indexes may be specified by prefixing
480+
only matters on compound indexes. Text indexes may be specified by prefixing
481481
the field name with a **$**. Hashed indexes may be specified by prefixing
482482
the field name with a **#**::
483483

@@ -488,14 +488,14 @@ the field name with a **#**::
488488
created = DateTimeField()
489489
meta = {
490490
'indexes': [
491-
'title',
491+
'title', # single-field index
492492
'$title', # text index
493493
'#title', # hashed index
494-
('title', '-rating'),
495-
('category', '_cls'),
494+
('title', '-rating'), # compound index
495+
('category', '_cls'), # compound index
496496
{
497497
'fields': ['created'],
498-
'expireAfterSeconds': 3600
498+
'expireAfterSeconds': 3600 # ttl index
499499
}
500500
]
501501
}

0 commit comments

Comments
 (0)