Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j Cypher, START n=node(id) over MATCH id(n)=id

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

like image 995
Sovos Avatar asked Feb 08 '14 20:02

Sovos


People also ask

What does match do in Neo4j?

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.

How do you create a relationship between two nodes in Neo4j?

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.

Can u relabel node in Neo4j?

You can change the nodes associated with a label but you can't change the type of a relationship.

How do I return all nodes and relationships in Neo4j?

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.


1 Answers

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.

like image 175
Stefan Armbruster Avatar answered Oct 13 '22 01:10

Stefan Armbruster