Improve compound indexes in rst

This commit is contained in:
Bastien Gerard 2021-10-12 21:02:12 +02:00
parent 8c3e2b340b
commit 4210ea06c3

View File

@ -477,7 +477,7 @@ dictionary containing a full index definition.
A direction may be specified on fields by prefixing the field name with a A direction may be specified on fields by prefixing the field name with a
**+** (for ascending) or a **-** sign (for descending). Note that direction **+** (for ascending) or a **-** sign (for descending). Note that direction
only matters on multi-field indexes. Text indexes may be specified by prefixing only matters on compound indexes. Text indexes may be specified by prefixing
the field name with a **$**. Hashed indexes may be specified by prefixing the field name with a **$**. Hashed indexes may be specified by prefixing
the field name with a **#**:: the field name with a **#**::
@ -488,14 +488,14 @@ the field name with a **#**::
created = DateTimeField() created = DateTimeField()
meta = { meta = {
'indexes': [ 'indexes': [
'title', 'title', # single-field index
'$title', # text index '$title', # text index
'#title', # hashed index '#title', # hashed index
('title', '-rating'), ('title', '-rating'), # compound index
('category', '_cls'), ('category', '_cls'), # compound index
{ {
'fields': ['created'], 'fields': ['created'],
'expireAfterSeconds': 3600 'expireAfterSeconds': 3600 # ttl index
} }
] ]
} }