g.V().
has('organizationId', 'b121672e-8049-40cc-9f28-c62dff4cc2d9').
hasLabel('employee').
or
(
has('firstName', containing('K')),
has('lastName', containing('K')),
has('department', containing('K'))
).
order().
by('lastName').
project('EmployeeId', 'FirstName', 'LastName','Status', 'EndDate', 'WorkLocation', 'LastHealthCheck', 'Nearby', 'Frequent', 'Department', 'ConfirmationDate' ).
by(id).
by('firstName').
by('lastName').
by('status').
by('endDate').
by('workLocation').
by('lastHealthCheckUp').
by('nearby').
by('frequent').
by('department').
by('confirmationDate')
The query is used to get employee details, but I want to perform sorting for all the fields dynamically, Eg: From UI Let say FirstName parameter is passed as ascending/Descending order then the query should perform ordering in ascending order or in descending order, I have performed sorting but query only accept ascending as a single parameter, I want my query to accept sorting parameters and perform sorting based on it for all the mentioned fields.