We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dbc31f0 + 669f3ba commit dd17d73Copy full SHA for dd17d73
mongoengine/queryset/base.py
@@ -722,7 +722,7 @@ def with_id(self, object_id):
722
:param object_id: the value for the id of the document to look up
723
"""
724
queryset = self.clone()
725
- if not queryset._query_obj.empty:
+ if queryset._query_obj:
726
msg = "Cannot use a filter whilst using `with_id`"
727
raise InvalidQueryError(msg)
728
return queryset.filter(pk=object_id).first()
0 commit comments