Skip to content

Commit 9ab79d0

Browse files
committed
ObjectId Fields does not support integers
1 parent a8f6034 commit 9ab79d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

django_mongodb_backend/base.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def _isnull_operator(a, b):
127127
"iregex": lambda a, b: regex_match(a, b, insensitive=True),
128128
}
129129

130+
# Maps Django internal type to atlas search index type.
130131
mongo_data_types = {
131132
"AutoField": "number",
132133
"BigAutoField": "number",
@@ -154,8 +155,8 @@ def _isnull_operator(a, b):
154155
"TextField": "string",
155156
"TimeField": "date",
156157
"UUIDField": "uuid",
157-
"ObjectIdAutoField": ["objectId", "number"],
158-
"ObjectIdField": ["objectId"],
158+
"ObjectIdAutoField": "objectId",
159+
"ObjectIdField": "objectId",
159160
"EmbeddedModelField": "embeddedDocuments",
160161
}
161162

0 commit comments

Comments
 (0)