mongo $and list should not contain list elements in order to avoid this error:
$and/$or elements must be objects
This commit is contained in:
parent
0ffe79d76c
commit
d80be60e2b
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user