Skip to content

Commit 24136df

Browse files
committed
Fix none() no-match condition for aggregation + update changelog
1 parent 0767033 commit 24136df

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Development
1212
- BREAKING CHANGE: connecting MongoEngine with mongomock should now use the new `mongo_client_class`
1313
For more info, check https://docs.mongoengine.org/guide/mongomock.html
1414
- Fix DictField that always gets marked as changed #2606
15+
- fix for Queryset.none() that has no effect on update/aggregate / first #2669
1516

1617
Changes in 0.26.0
1718
=================

mongoengine/queryset/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ def aggregate(self, pipeline, *suppl_pipeline, **kwargs):
13161316
initial_pipeline = []
13171317
if self._none or self._empty:
13181318
initial_pipeline.append({"$limit": 1})
1319-
initial_pipeline.append({"$match": {"fldksjhkjhafds": "lasdjfhlasdhfk"}})
1319+
initial_pipeline.append({"$match": {"$expr": False}})
13201320

13211321
if self._query:
13221322
initial_pipeline.append({"$match": self._query})

0 commit comments

Comments
 (0)