I was wondering how
WHERE id(n) = id
compares to
START n = node(id)
as most of the time I do not select nodes by id (at least in number of code appearances) and therefore like to do it always in the match
The MATCH clause allows you to specify the patterns Neo4j will search for in the database. This is the primary way of getting data into the current set of bindings. It is worth reading up more on the specification of the patterns themselves in Patterns.
To create a relationship between two nodes, we first get the two nodes. Once the nodes are loaded, we simply create a relationship between them. The created relationship is returned by the query.
You can change the nodes associated with a label but you can't change the type of a relationship.
When you want to return all nodes, relationships and paths found in a query, you can use the * symbol. This returns the two nodes, the relationship and the path used in the query.
The two statements are identical. START
is the syntax to be used in Neo4j 1.x. From Neo4j 2.0 the MATCH
variant should be preferred, maybe START
will get deprecated at some future release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With