Fix query unpacking issue with $not operator

This commit is contained in:
Zaid Abdulla committed 2018-04-30 17:11:05 -07:00
1 parent 09defce511
commit 0cae1485b5
1 file changed
+3 -1
+3 -1
View File
@@ -149,7 +149,9 @@ expand = (query) ->
conditions = permute(k, v)
if conditions.length > 1
new_query['$and'] ?= []
if v?['$ne']?
if v?['$ne']? or v?['$not']?
if Object.keys(v) > 1
throw new Error("Cannot mix $ne or $not with other operators")
for c in conditions
new_query['$and'].push(c)
else