Skip to content

Commit 593abb7

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

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/ref/models/fields.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ 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>`. Supporting them would require
51+
using operators like ``$getField`` which prevents queries from using indexes.
52+
4253
MongoDB-specific model fields
4354
=============================
4455

0 commit comments

Comments
 (0)