Fix alias unpacking bug in queries with $ne operator
This commit is contained in:
1 parent
7606d25e4b
commit
973e82cf94
1 file changed
+5
-3
+5
-3
@@ -95,10 +95,12 @@ expand = (query, aliases) ->
|
||||
else
|
||||
conditions = permute(k, v, aliases)
|
||||
if conditions.length > 1
|
||||
if new_query['$and']?
|
||||
new_query['$and'].push({'$or' : conditions})
|
||||
new_query['$and'] ?= []
|
||||
if v?['$ne']?
|
||||
for c in conditions
|
||||
new_query['$and'].push(c)
|
||||
else
|
||||
new_query['$and'] = [{'$or' : conditions}]
|
||||
new_query['$and'].push({'$or' : conditions})
|
||||
else
|
||||
common.extend(new_query, conditions[0])
|
||||
|
||||
|
||||
Reference in new issue
Block a user