Skip to content

Commit 3c24e10

Browse files
WaVEVtimgraham
authored andcommitted
improved readabilty of negated queries by using $not
1 parent d222bd8 commit 3c24e10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_mongodb/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def where_node(self, compiler, connection):
269269
raise FullResultSet
270270

271271
if self.negated and mql:
272-
mql = {"$eq": [mql, {"$literal": False}]}
272+
mql = {"$not": mql}
273273

274274
return mql
275275

0 commit comments

Comments
 (0)