We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c199efa commit 305cc39Copy full SHA for 305cc39
test/correctness/util.py
@@ -408,7 +408,7 @@ def mongo_sort_list_by_fields_list(array, field_name_list):
408
return mongo_sort_list_by_fields(array, field_name_map)
409
410
def sorte_id_field(doc):
411
- if isinstance(doc['_id'], dict):
+ if '_id' in doc.keys() and isinstance(doc['_id'], dict):
412
od = HashableOrderedDict()
413
for k,v in sorted(doc['_id'].items(), key=lambda kv: kv[0]):
414
od[k] = v
0 commit comments