4.2. Start

4.2.1. Node by id
4.2.2. Multiple nodes by id
4.2.3. Node by index lookup
4.2.4. Node by index query
4.2.5. Multiple start points

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.

4.2.1. Node by id

Including a node as a start point is done by using parenthesis.

Graph

Query

start n=(1) return n

The reference node is returned

Result

 +--------------------+
 | n                  |
 +--------------------+
 | Node[1]{name->"A"} |
 +--------------------+
 1 rows, 1 ms

4.2.2. Multiple nodes by id

Multiple nodes are selected by listing them separated by commas.

Graph

Query

start n=(1, 2, 3) return n

The nodes listed in the START statement.

Result

 +--------------------+
 | n                  |
 +--------------------+
 | Node[1]{name->"A"} |
 | Node[2]{name->"B"} |
 | Node[3]{name->"C"} |
 +--------------------+
 3 rows, 0 ms

4.2.3. Node by index lookup

If the start point can be found by index lookups, it can be done like this: (index-name, key, "value"). Like this:

Graph

Query

start n=(nodes,name,"A") return n

The node indexed with name "A" is returned

Result

 +--------------------+
 | n                  |
 +--------------------+
 | Node[1]{name->"A"} |
 +--------------------+
 1 rows, 1 ms

4.2.4. Node by index query

If the start point can be found by index queries, it can be done like this: (index-name, "query").This allows you to write more advanced index queries

Graph

Query

start n=(nodes,"name:A") return n

The node indexed with name "A" is returned

Result

 +--------------------+
 | n                  |
 +--------------------+
 | Node[1]{name->"A"} |
 +--------------------+
 1 rows, 1 ms

4.2.5. Multiple start points

Sometimes you want to bind multiple start points. Just list them separated by commas.

Graph

Query

start a=(1), b=(2) return a,b

Both the A and the B node are returned

Result

 +-----------------------------------------+
 | a                  | b                  |
 +-----------------------------------------+
 | Node[1]{name->"A"} | Node[2]{name->"B"} |
 +-----------------------------------------+
 1 rows, 1 ms