Here's the graph I'm working on.
g = TinkerGraph.open().traversal()
first_generation = g.addV('person').property('id', '1').next()
second_generation = g.addV('person').property('id', '2').next()
third_generation = g.addV('person').property('id', '3').next()
third_generation_1 = g.addV('person').property('id', '4').next()
fourth_generation = g.addV('person').property('id', '5').next()
g.addE('child').from(first_generation).to(second_generation)
g.addE('child').from(second_generation).to(third_generation)
g.addE('child').from(second_generation).to(third_generation_1)
g.addE('child').from(third_generation).to(fourth_generation)
Here, I want to fetch the list of all people with the number of children they have.
[{'id': 1, 'children': 1}, {'id': 2, 'children': 2}]
I read about sideEffect
but can't seem to append the result of sideEffect to the output.
Any suggestions on how we can achieve the desired output ?