4
votes

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.

1

1 Answers

4
votes

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)))