2
我一直面臨着奇怪的問題,我試圖讓從Neo4j的圖形,我有built.Here數據是我的查詢Neo4j的暗號查詢空收集使整個結果空
MATCH (u1:User {user_id: 4})-[:FOLLOWS]->(u2:User)-[]->(r1:Rest{city_id: 1})
WITH COLLECT ({ REST: r1.res_id}) as rows
MATCH (u1:User {user_id: 4})-[rel]->(r2:Rest{city_id: 1})
WHERE NOT (u1:User {user_id: 4})-[rel : BEEN_THERE | ADD_REVIEW]->(r2:Rest{city_id: 1})
WITH rows + COLLECT ({ REST: r2.res_id}) AS allrows
UNWIND allrows as row
RETURN row.REST as RESTAURANT_ID, count(row.REST) as COUNT
ORDER BY COUNT desc
LIMIT 15;
然而,當結果COLLECT({REST:r2.res_id})爲空,整個結果變爲空。此外,查詢無法識別第一個匹配的行,並返回undefined rows
。請告訴我。謝謝!
非常感謝弗蘭克爲您的答案!它工作正常。 –
@AditKaushal不要猶豫,然後[接受(並投票)](https://stackoverflow.com/help/someone-answers)答案。 –