[Neo4j] Gremlin - how to flatten a tree, and sort

Marko Rodriguez okrammarko at gmail.com
Tue Nov 8 08:53:39 CET 2011


Hey,

> I figured I needed to do a projection of sorts, and the only thing I
> could get working was a transform(), as follows:
> 
> m.sort{a,b -> a.value <=> b.value}._().transform(){a -> a.key}

	m.sort{a,b -> a.value <=> b.value}.keySet()

...will return you the keys of the map in sorted order.

HTH,
Marko.

http://markorodriguez.com


More information about the User mailing list