Using the gremlin console connected remotely to a Neptune DB instance, I'm trying to range from a given index to the last result. It seems like Neptune doesn't accept range(0,-1)
. It's not throwing an error when I try it, it's just returning an empty list. My thought is to somehow count and store the results, and use the count as the second argument, but I'm not sure how to do that. I know that this particular case is the same as not using a range, but I'm writing code that takes optional input for the start and limit indices, so I need it to be able to handle input of { start: 0 }
without a limit.
Sample data:
g.addV().addV().addV()
Traversals and outputs:
g.V()
==>v[0]
==>v[1]
==>v[2]
g.V().range(0,1)
==>v[0]
g.V().range(1,-1)
==>v[1]
==>v[2]
g.V().range(0,-1)
//returns nothing
I would expect the last traversal to give the same output as the first.
Is there a way to do something like g.V().range(0,count())
?