I have a bunch of vertices, and I am simply grouping them by a key that is another vertex (orientDB is my datastore):
g.v('8:0').copySplit(_().out('follow').out('stream'), _().out('stream')).fairMerge().dedup().groupBy{it.out('object') ? it.out('object') : 'test'}{it.content}.cap
Note that not all "stream" vertices have another vertex connected to it via an "object" edge, but that is is fine, because they will just be grouped under the 'test' key.
However, I ended up with this as the output (in the gremlin console):
==>{[StartPipe, OutPipe(object)]=[Hi dudes check out this link! -sarah], [StartPipe, OutPipe(object)]=[awesome
site], test=[Hi Jenny!, This is my second post!!, This is my first post!!], [StartPipe, OutPipe(object)]=[Hi
check out this link!]}
Why is [StartPipe, OutPipe(object)] being used as the key and not the vertex? Also, all the entries with [StartPipe, OutPipe(object)] with the key refer to the same vertex, so they should all be grouped together.
Any ideas appreciated :)