New Milestone Release Neo4j 2.0.0-M03

New Milestone Release Neo4j 2.0.0-M03 by Michael Hunger.

From the post:

The latest M03 milestone release of Neo4j 2.0 is as you expected all about improvements to Cypher. This blog post also discusses some changes made in the last milestone (M02) which we didn’t fully cover.

MERGE

Cypher now contains a MERGE clause which is pretty big: It will be replacing CREATE UNIQUE as it also takes indexes and labels into accounts and can even be used for single node creation. MERGE either matches the graph and returns what is there (one or more results) or if it doesn’t find anything it creates the path given. So after the MERGE operation completes, Neo4j guarantees that the declared pattern is there.

We also added additional clauses to the MERGE statement which allow you to create or update properties as a function of whether the node was matched or created. Please note that — as patterns can contain multiple named nodes and relationships — you will have to specify the element for which you want to trigger an update operation upon creation or match.

MERGE (keanu:Person { name:'Keanu Reeves' })
ON CREATE keanu SET keanu.created = timestamp()
ON MATCH  keanu SET keanu.lastSeen = timestamp()
RETURN keanu

We put MERGE out to mainly collect feedback on the syntax and usage, there are still some caveats, like not grabbing locks for unique creation so you might end up with duplicate nodes for now. That will all be fixed by the final release.

Going along with MERGE, MATCH now also supports single node patterns, both with and without labels.

(…)

MERGE is definitely something to investigate in this milestone release.

You need to also take a close look at labels.

What issues, if any, do you see with the label mechanism?

I see several but will cover them early next week. Work up your list (if any) to see if we reach similar conclusions.

Comments are closed.