我有以下查詢重新安排基於另一個集合集合列表
neo4j-sh (?)$
$start n=node(*) match p=n-[r:LIKES]->items return n,collect(r.w),collect(items.name);
==> +------------------------------------------------------------------------------------------------------------------+
==> | n | collect(r.w) | collect(items.name) |
==> +------------------------------------------------------------------------------------------------------------------+
==> | Node[249]{name:"u1"} | [0,0.93] | ["f5","f2"] |
==> | Node[248]{name:"u2"} | [0,-0.76,1,-0.66] | ["f4","f3","f2","f1"] |
==> +------------------------------------------------------------------------------------------------------------------+
我想重新排序的項目按照類似下面的
==> +------------------------------------------------------------------------------------------------------------------+
==> | n | collect(r.w) | collect(items.name) |
==> +------------------------------------------------------------------------------------------------------------------+
==> | Node[249]{name:"u1"} | [0.93,0] | ["f2","f5"] |
==> | Node[248]{name:"u2"} | [1,0,-0.66,-0.76] | ["f2","f4","f1","f3"] |
==> +------------------------------------------------------------------------------------------------------------------+
如何RW的排序值我可以根據collect(rw)的排序值重新排列collect(items.name)的元素嗎?
這可能會有幫助。 http://docs.neo4j.org/chunked/milestone/query-with.html#with-sort-results-before-using-collect-on-them – Nicholas
謝謝,但我需要重新排列項目集合根據排序的值的rw集合,我不知道如何去做 – user1848018