0
Neo4j的暗號查詢來獲取訂單數:GROUPBY一年,然後一個月,然後ORG明智爲GROUPBY多個實體Neo4j的暗號查詢
MATCH (year)-[:MONTH]->(month:Month)
WITH year,month
MATCH (month)-[r:DAY]->(day:Day)
WITH year,month,day
OPTIONAL MATCH (order:Order)-[r:ORD_CREATED]->(day)
WITH year,month,order
MATCH (order)-[:ORDER_OF]-(org)
RETURN year,month,COLLECT(DISTINCT(org.name),count(order))
我如何能實現以下輸出?任何幫助,將不勝感激
{
year
[{month1,[ {org1,20},{ org2,30}]}],
[{month2,[ {org1,26},{ org2,10}]}],
}
感謝您的答覆 –