Reputation: 6270
I setup my db (Neo4j 2.0 M06) like so:
CREATE (alex:Person {Name:'Alex'})
CREATE (alice:Person {Name:'Alice'})
CREATE (brenda:Person {Name:'Brenda'})
CREATE alex-[:KNOWS]->alice
Which gives me (as expected) one disconnected node (Brenda) and two connected nodes. Now, I'd like to use MERGE
to create a relationship between Alex and Brenda, so I try:
MATCH (alex:Person { Name:'Alex' }),(brenda:Person { Name:'Brenda' })
MERGE (alex)-[r:KNOWS]->(brenda)
RETURN r
Which as far as I can see - is pretty identical to the documentation example, but then I get the following error:
Node properties cannot be specified in this context (line 1, column 20)
"MATCH (alex:Person { Name:'Alex' }),(alice:Person { Name:'Brenda' })"
^
By the by - I copy and paste the documentation example into my DB UI I get the same error.
I can't use a WHERE
clause as:
MERGE only supports single node patterns
I presume I have got the MERGE
statement wrong... but how?
Upvotes: 0
Views: 129
Reputation: 9952
MATCH with properties and MERGE with relationships are available first in 2.0-RC1.
Upvotes: 1