Database Reference
In-Depth Information
simpler to read and understand for developers, operational staff, and anyone with enough
domain understanding.
Note
From Neo4j 2.0, the
start
clause is optional. If the
start
clause is omitted, Neo4j will
try to infer it from the node labels and properties in the
match
clause of the query. For
clarity and compatibility with earlier Neo4j versions, all queries in this chapter will have
Thatsaid,howdoyouactuallyexecutetheCypherquery?Don'tworry—we'llexplainthat
in the next section.
6.1.2. Executing Cypher queries
There are a number of ways you can execute Cypher queries. Neo4j ships with a couple
of tools that support Cypher executions, and Cypher can also be executed from Java code,
much like SQL.
Table 6.1
shows the Cypher execution options.
Table 6.1. Tools and techniques for executing Cypher queries
Tool
Description
Neo4j Shell
Command-line tool
Neo4j Web Admin Console
Web-based interface
Java
Programmatically
REST
Over HTTP using REST interface
Let's take a look at each of the first three options in more detail. The fourth option, using
REST to execute Cypher queries, will be discussed in
chapter 10
.
Executing Cypher using the Neo4j Shell
The Neo4j Shell is a command-line tool that's part of the Neo4j distribution. It can be used
to connect to either of the following: