diff --git a/src/storage/v3/request_helper.hpp b/src/storage/v3/request_helper.hpp index 94220f214..08094e8ba 100644 --- a/src/storage/v3/request_helper.hpp +++ b/src/storage/v3/request_helper.hpp @@ -121,7 +121,14 @@ template concept VerticesIt = utils::SameAsAnyOf>; template std::vector> OrderByVertices(Shard::Accessor &acc, DbAccessor &dba, TIterable &iterable, - std::vector &order_bys) { + std::vector &original_order_bys) { + auto order_bys = original_order_bys; + auto it_to_remove = std::remove_if(order_bys.begin(), order_bys.end(), [](const auto &order_by) { + // We only want to keep OrderBys not impliying edges-ordering + return std::string::npos != order_by.expression.expression.find(expr::identifier_edge_symbol); + }); + order_bys.erase(it_to_remove, order_bys.end()); + std::vector ordering; ordering.reserve(order_bys.size()); std::transform(order_bys.begin(), order_bys.end(), std::back_inserter(ordering), [](const auto &order_by) {