File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ Django MongoDB Backend 5.2.x
1010New features
1111------------
1212
13- - ...
13+ - Added support for creating indexes from expressions.
14+ Currently, only ``F() `` expressions are supported to reference top-level
15+ model fields inside embedded models.
16+
17+
1418
1519Bug fixes
1620---------
Original file line number Diff line number Diff line change 1+ ## Indexes from Expressions
2+
3+ Django MongoDB Backend now supports creating indexes from expressions.
4+ Currently, only ` F() ` expressions are supported, which allows referencing
5+ fields from the top-level model inside embedded fields.
6+
7+ Example:
8+ ``` python
9+ class Author (models .EmbeddedModel ):
10+ name = models.CharField()
11+
12+ class Book (models .Model ):
13+ author = models.EmbeddedField(Author)
14+
15+ class Meta :
16+ indexes = [
17+ models.Index(F(" author__name" )),
18+ ]
You can’t perform that action at this time.
0 commit comments