Gremlin query to get vertices which are having edges equal to 2

Viewed 2039

consider I have around 5 vertices from v1 to v5. and having the edges between them. the structure is below.

v1->v2
v1->v3
v4->v2
v2->v1
v2->v3
v3->v5
v5->v1

Now I want to write a gremlin query to display the vertices which is having outgoing edges is 2.

for example v1 is having 2 outgoing edges to v2 and v3 so here the query should display v1,v2,v3

1 Answers
Related