Merge pull request #845 from aeroeng/andQ

mongo $and list should not contain list elements in order to avoid this ...
This commit is contained in:
Yohan Graterol 2015-01-22 20:13:53 -05:00
commit 1cc7f80109

View File

@ -160,7 +160,7 @@ def query(_doc_cls=None, _field_operation=False, **query):
if isinstance(v, list):
value = [{k: val} for val in v]
if '$and' in mongo_query.keys():
mongo_query['$and'].append(value)
mongo_query['$and'].extend(value)
else:
mongo_query['$and'] = value