i am new to gremlin, here is what i am trying to do..
I have a 'product' vertex and a 'user' vertex. I have a product -> 'linkedto' -> user edge.. This edge has 2 properties 'type' and 'joinedon'. I am trying to fetch list of users who are linked to the product grouped by the 'type' property of the edge. The output should be something like this:
type: [
{name, email..., joinedon}, // user1 details + joinedon (from the edge)
{name, email..., joinedon}, // user2 details + joinedon (from the edge)
]
I have got to a point where i get grouped users with their details with this query
g.V(productid).outE('linkedto').as('a')
.inV().as('b').group().by(select('a').values('type')).unfold()
.project('type','user').by(select(keys)).by(select(values))
Questions:
- How can i get the joinedon from edge in result?
- How to select only specific fields from the edge and vertex (user) in the result?