Every query describes a pattern, and in that pattern one can have multiple bound points. A bound point is a relationship or a node that form the starting points for a pattern match. You can either bind points by id, or by index lookups.
Graph
Binding a node as a start point is done with the node(*) function .
Query
START n=node(1) RETURN n
The reference node is returned
Binding a relationship as a start point is done with the relationship() function, which can also be abbreviated rel().
Query
START r=relationship(0) RETURN r
The relationship with id 0 is returned
Multiple nodes are selected by listing them separated by commas.
Query
START n=node(1, 2, 3) RETURN n
The nodes listed in the START statement.
If the start point can be found by index lookups, it can be done like this: node:index-name(key = "value"). In this example, there exists a node index named nodes.
Query
START n=node:nodes(name = "A") RETURN n
The node indexed with name "A" is returned
If the start point can be found by index lookups, it can be done like this: relationship:index-name(key = "value"].
Query
START r=relationship:rels(property = "some_value") RETURN r
The relationship indexed with property "some_value" is returned
If the start point can be found by index more complex lucene queries: node:index-name("query").This allows you to write more advanced index queries
Query
START n=node:nodes("name:A") RETURN n
The node indexed with name "A" is returned
Copyright © 2012 Neo Technology