First off, I'm new to Gremlin, so any advice would be hugely appreciated!
I'm trying to get an alphabetically ordered list of people, alongside their soonest session by start date. My graph looks like this -
person.1[V] - has_session[E] -> session.1[V]
person.1[V] - has_session[E] -> session.2[V]
person.2[V] - has_session[E] -> session.3[V]
person.2[V] - has_session[E] -> session.4[V]
Person vertexes have a name attribute, and session vertexes have a start time attribute with a unix timestamp.
I'd like to return all the attributes for both the person and the session, such as with elementMap().
I can't seem to work out how to maintain the two sorts, name of person, and start of session, and apply the limits to only one part.
g.V().hasLabel('person').
order().by('name').
as('person').
out('has_session').has('start', gte(1595805580)).
as('sessions').
dedup('person').path().
select('person', 'sessions').
by(elementMap())