g.V().hasLabel('employee').fold().as("emp", "count")
.select("emp", "count")
.by(range(local, 0, 2).elementMap())
.by(count(local));
The above query is working fine when the range interval is 1 (OR) total number of return vertex is 1.
If it has more than one vertex or the range interval is increased, getting the UnsupportedOperationException
exception. How to solve?
The same query works without elementMap()
, however, it's needed in application just vertex id is not helpful