In Gremlin, we can paginate like this:
gremlin> g.V().hasLabel('person').fold().as('persons','count').
select('persons','count').
by(range(local, 0, 2)).
by(count(local))
==>[persons:[v[1],v[2]],count:4]
I'm trying to do the same thing in Java, but have no idea what local
is in this case. My current query looks like this:
.fold()
.as("persons", "count")
.select("persons", "count")
.by(__.range(0, 2))
.by(__.count())
However, it always returns all results with a count of 1. How would the pagination be correctly performed in Java?