Hey,
> Using the REST API
>
> g.v(0).out.unique().sort{it.Name}.toList()
Cool.
> works but i can't get
>
> t = new Table();
> g.v(0).out.as('friend').table(t).sort{it.Name} >> -1;
> t;
>
> to sort correctly.
Table will simply pass the object through itself (it is a side-effect step).
Thus, you are sorting on 'out name' in the stream, not on the table.
t = new Table();
g.v(0).out.as('friend').table(t){it.Name} >> -1
t.sort();
OR
t = new Table();
g.v(0).out.as('friend').table(t) >> -1
t.sort{it.Name};
---depends on what you want stored in the table. the first stores the Name, not
the vertex.
*****ANALOGOUS TO THE LAST, BUT MORE CONCISE
g.v(0).out.as('friend').table.cap.next().sort{it.Name}
******
> and how would i sort
>
> g.v(0).out.as('friend').out.as('moreFriend').sort( on friend.Name )
>
> Also, can you point me to some documentation on this and other commends that
> can be preformed on this pipe. I have been searching and have not found
> anything straight forward (could be me...)
t = new Table();
g.v(0).out.as('friend').out.as('moreFriends').table(t) >> -1
t.sort{it[0].Name}
--- or if you want to use column names as opposed to column indices:
t.sort{it.getColumn('friend').Name}
I just added some of this to the Gremlin Wiki.
https://github.com/tinkerpop/gremlin/wiki/Pattern-Match-Pattern (at
bottom)
Thanks for the question,
Marko.
http://markorodriguez.com
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user