sortQueryRows function
Sorts (id, doc) rows in place by order with the id tiebreak.
Implementation
void sortQueryRows(
List<(String, Map<String, Object?>)> rows,
Iterable<QueryOrder> order,
) {
final keys = order.toList();
rows.sort((a, b) => compareQueryRows(a, b, keys));
}