Skip to content

Commit 03b7c93

Browse files
committed
Document that $ and . aren't supported in Field.db_column
1 parent b3e98e1 commit 03b7c93

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/ref/models/fields.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ A few notes about some of the other fields:
3939
- Similarly, all :class:`~django.db.models.DurationField` values are stored as
4040
:class:`bson.int64.Int64`.
4141

42+
Model field options
43+
===================
44+
45+
Some notes about model field options:
46+
47+
- Dollar signs and periods (``$`` and ``.``) are not supported in
48+
:attr:`Field.db_column <django.db.models.Field.db_column>` because these field
49+
names are :doc:`discouraged by MongoDB
50+
<manual:core/dot-dollar-considerations>`. Querying fields with these
51+
characters requires the ``$getField`` operator, which prevents queries from
52+
using indexes.
53+
4254
MongoDB-specific model fields
4355
=============================
4456

0 commit comments

Comments
 (0)