We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d55d9b commit d9c04dcCopy full SHA for d9c04dc
docs/topics/indexes.rst
@@ -0,0 +1,22 @@
1
+Indexes from Expressions
2
+========================
3
+
4
+Django MongoDB Backend now supports creating indexes from expressions.
5
+Currently, only ``F()`` expressions are supported, which allows referencing
6
+fields from the top-level model inside embedded fields.
7
8
+Example::
9
10
+ from django.db import models
11
+ from django.db.models import F
12
13
+ class Author(models.EmbeddedModel):
14
+ name = models.CharField()
15
16
+ class Book(models.Model):
17
+ author = models.EmbeddedField(Author)
18
19
+ class Meta:
20
+ indexes = [
21
+ models.Index(F("author__name")),
22
+ ]
0 commit comments