Skip to content

Commit 7f53f46

Browse files
committed
Using text field instead of ObjectIdField.
1 parent 72a43e1 commit 7f53f46

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

django_mongodb/fields/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from .auto import ObjectIdAutoField
22
from .duration import register_duration_field
33
from .json import register_json_field
4-
from .object_id import ObjectIdField
54

6-
__all__ = ["register_fields", "ObjectIdAutoField", "ObjectIdField"]
5+
__all__ = ["register_fields", "ObjectIdAutoField"]
76

87

98
def register_fields():

django_mongodb/fields/object_id.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

django_mongodb/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def join(self, compiler, connection):
115115
# The pipeline variables to be matched in the pipeline's
116116
# expression.
117117
"let": {
118-
f"{parent_template}{i}": parent_field
118+
f"{parent_template}{i}": {"$toString": parent_field}
119119
for i, parent_field in enumerate(lhs_fields)
120120
},
121121
"pipeline": [
@@ -129,7 +129,7 @@ def join(self, compiler, connection):
129129
"$match": {
130130
"$expr": {
131131
"$and": [
132-
{"$eq": [f"$${parent_template}{i}", field]}
132+
{"$eq": [f"$${parent_template}{i}", {"$toString": field}]}
133133
for i, field in enumerate(rhs_fields)
134134
]
135135
}

0 commit comments

Comments
 (0)