Combine a raw query with an existing one
(value, mongo_query)
| 63 | |
| 64 | |
| 65 | def handle_raw_query(value, mongo_query): |
| 66 | """Combine a raw query with an existing one""" |
| 67 | for op, v in value.items(): |
| 68 | if op not in mongo_query: |
| 69 | mongo_query[op] = v |
| 70 | elif op in mongo_query and isinstance(mongo_query[op], dict): |
| 71 | mongo_query[op].update(v) |
| 72 | |
| 73 | |
| 74 | # TODO make this less complex |