I create an empty graph partitioned on 'a' and seed with the following:
g.addV('person').property('a','1').property('name','person 1').property('number',1)
g.addV('person').property('a','1').property('name','person 2').property('number',2)
g.addV('person').property('a','1').property('name','person 3').property('number',3)
g.V().order().by('number')
returns: person 1, person 2, person 3
g.V().order().by('number').tail(1)
returns: person 1
I expected .tail() to return from the end of the list
Whats weird is that when i select just a property it works just as I expected:
g.V().order().by('number').properties('name')
returns: person 1, person 2, person 3
g.V().order().by('number').properties('name').tail(1)
returns: person 3
When I try the same in the tinkerpop gremlin console, tail(1) returns the last entry for both variations..
Am I missing something? I find it hard to believe that this is an actual bug.
Edit: I have managed to get it to work by doing a .fold().unfold()
before .tail()
.. Still have no idea what is going on here..