Database Reference
In-Depth Information
Start
In certain instances, your application can provide a starting point with the query to begin at a certain point within the
graph. Nonetheless, the START clause is optional and Cypher can infer a starting point based on other clauses within
the query, as shown in Listings 4-33 and 4-34. Again, you should use MATCH in most read operations when specifying a
beginning point in your statement. START should be used when working with legacy indexes.
Listing 4-33. START Using a Node id
START n=node (1)
RETURN n
Listing 4-34. START Using a Property in a Lucene Index
START n=node:nodes("username:greg")
RETURN n
Writing
The preceding sections covered a number of clauses that allow writing to occur within the graph. This section shows
some clauses for writing to the graph.
SET
The “SQL to Cypher” section covered some common SET operations. Listings 4-35, 4-36, and 4-37 are further
examples of using SET in Cypher.
Listing 4-35. Set Properties from a Map
MATCH (user { username: "greg" })
SET user += { active: TRUE , business: 'Graph Story' }
Listing 4-36. Set Multiple Properties in a SET
MATCH (user { username: "greg" })
SET user.business: 'Graph Story', user.lastname: 'Jordan'
Listing 4-37. Set Multiple Labels on a Node in a SET
MATCH (user { username: "greg" })
SET user :WRITER:DEVELOPER
 
Search WWH ::




Custom Search