unwind;可以将一个列表展开为一个行的序列
1.列表
unwind[1,2,3]as x return x
2.创建唯一列表
with[1,2,3,3]as coll unwind coll as x with distinct x return collect(x)as set
3.从列表参数创建节点
:params {event:[{"year":2014,"id":1},{"year":2014,"id":2}]}
或者:params {event:[{year:2014,id:1},{year:2014,id:2}]}
unwind $event as event
merge(y:Year{year:event.year})
merge(y)<-[:IN]-(e:Event{id:event.id})
return e.id as x order by x
转载于:https://www.cnblogs.com/hapyygril/p/10268131.html