2013-05-07 58 views
3

給它們的屬性兩個節點之間的關係,我想這樣做如何使用CYPHER創造的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子句。做這個的最好方式是什麼?

非常感謝!

回答

8

你得到了什麼錯誤,表明Neo4j不喜歡where子句?

我對console.neo4j.org

START n=node(*), m=node(*) 
where has(n.name) and has(m.name) and n.name='Neo' 
create (n)-[:FRIENDSHIP {status:2}]->(m) 

,並運行良好。 請注意,您錯過了:在關係名稱前面。這是它抱怨的錯誤嗎?

你使用什麼版本以防萬一這仍然不起作用?

+0

嗨Luanne,非常感謝您的回覆!我嘗試了類似的方式START n = node(*),m = node(*)where has(n.userid)and has(m.userid)and n.userid ='2'and n.userid ='3'create(n ) - [:FRIENDSHIP {status:2}] - >(m);它不報告錯誤。但是,Neoclipse不會在可視化中顯示邊緣。 – 2013-05-07 04:07:43

+0

我在node()中有*,它在工作粘貼 – 2013-05-07 04:08:19

+0

後就丟失了,我有兩個節點都是「n」,非常感謝! – 2013-05-07 04:10:06