I want a result like this:
[
{
"vertex": [ the_vertex_itself ]
},
{
"outgoingEdgeGroup1": [ list_of_outgoing_neighbors_with_edge_type_outgoingEdgeGroup1 ]
},
{
"outgoingEdgeGroup2": [ list_of_outgoing_neighbors_with_edge_type_outgoingEdgeGroup2 ]
}
]
I'm able to get this:
[
{
"outgoingEdgeGroup1": [ list_of_outgoing_neighbors_with_edge_type_outgoingEdgeGroup1 ]
},
{
"outgoingEdgeGroup2": [ list_of_outgoing_neighbors_with_edge_type_outgoingEdgeGroup2 ]
}
]
With the following query:
g.V('{unitId}').outE().group().by(label()).by(inV().fold())
But how would I append on the target vertex itself?
One way is just to use a
union
. If you need a more complete key/value type of structure that can be created also by addingproject
steps or nestedgroup
steps.Using the air-routes data set: