4

I have a query where I need to find the groupCount of a particular type of vertices where the count is greater than 1.

eg

g.V().hasLabel('airport').limit(40).groupCount().as('gc').by('region').having('gc',gt(1))

I know this syntax is not valid (especially the bold italic part), it's just to show what I'm trying to achieve.

Ujjwal Pathak
  • 646
  • 12
  • 21

1 Answers1

5

You can use where() after you unfold() the Map to key/value pairs:

g.V().hasLabel('airport').limit(40).
  groupCount().by('region').
  unfold().
  where(select(values).is(gt(1)))
stephen mallette
  • 45,298
  • 5
  • 67
  • 135