I want to perform dynamic ordering on a field through the gremlin query, I am using following query
g.inject('asc').as('mode').
V().
choose(select('mode').is('asc'),
order().by('lastName'),
order().by('lastName', decr)).
values('lastName')
This seems to work fine, but using inject is degrading the performance of the query.
Is there an alternative way of achieving the same functionality in Cosmos DB Gremlin API?