0

Trying to get the corresponding count of selected values in a single query with gremlin.

g
  .V("00000000000000000000000000000000").outE().as("fpEdges")
  .V("facade00-0000-4000-a000-000000000000").inE().as("vstEdges")
  .select("fpEdges", "vstEdges")
 .by(select('vstEdges').unfold().count())

When executed individually, these return 38 and 2 respectively.

Is there a way to get this statistics with a single query ?

Thanks!

1 Answers1

0

They are two independent traversals. I'm not sure you save much by running them as one but if you must there are many ways to combine them - here's one way with project():

g.V("00000000000000000000000000000000").
  project("fpEdges", "vstEdges").
    by(outE().count()).
    by(V("facade00-0000-4000-a000-000000000000").inE().count())
stephen mallette
  • 45,298
  • 5
  • 67
  • 135