如何使用cypher在Neo4j中给出它们的属性来创建两个节点之间的关系

Alf*_*ong 3 database neo4j graph-databases cypher

我想做这样的事情

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) ;
Run Code Online (Sandbox Code Playgroud)

但是,Neo4j不喜欢where子句.做这个的最好方式是什么?

非常感谢!

Lua*_*nne 8

你得到的错误表明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)
Run Code Online (Sandbox Code Playgroud)

console.neo4j.org上它运行正常.请注意,您错过了关系名称前面的:这是它抱怨的错误吗?

如果这仍然不起作用,您使用的是什么版本?