Skip to content

Commit c08ec71

Browse files
committed
fix: check parts length before get match
fix bugs which cause cannot modify field `type` etc.
1 parent 1790f3d commit c08ec71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mongoengine/queryset/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def update(_doc_cls=None, **update):
264264
op = operator_map.get(op, op)
265265

266266
match = None
267-
if parts[-1] in COMPARISON_OPERATORS:
267+
if len(parts) > 1 and parts[-1] in COMPARISON_OPERATORS:
268268
match = parts.pop()
269269

270270
# Allow to escape operator-like field name by __

0 commit comments

Comments
 (0)