[英]How to use cypher to create relationship between two nodes given their attributes in Neo4j
我想做這樣的事情
START n=node(*), m=node(*) where has(n.userid) and has(m.userid) and n.userid='0' and m.userid='3' create (n)-[FRIENDSHIP {status:2}]->(m) ;
但是,Neo4j不喜歡where子句。 做這個的最好方式是什么?
非常感謝!
您得到的錯誤表明Neo4j不喜歡where子句?
我跑了
START n=node(*), m=node(*)
where has(n.name) and has(m.name) and n.name='Neo'
create (n)-[:FRIENDSHIP {status:2}]->(m)
在console.neo4j.org上它運行正常。 請注意,您錯過了關系名稱前面的: 這是它抱怨的錯誤嗎?
如果這仍然不起作用,您使用的是什么版本?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.