Database Reference
In-Depth Information
Key operative words in Cypher
Like every database query language, there are a few operative words that have
an important meaning in the composition of every query. It's useful for you to
knowthesesinceyouwillbeusingthemtocomposeyourspeciicquerieson
yourspeciicdatasets.
Keyword
Function
Example
MATCH
MATCH (me:Person)-
[:KNOWS]->(friend)
This describes a pattern that the database
should match. This is probably the most
important piece of the query as it is a
structural component that always starts
your queries.
This filters results that are found in the
match for specific criteria.
WHERE me.name = "My
Name" AND me.age > 18
WHERE
RETURN
This returns results. You can either
return paths, nodes, relationships, or
their properties—or an aggregate of the
mentioned parameters. This is another
structural component, as all read queries
and most write queries will return some
data.
RETURN me.name,
collect(friend),
count(*) as friends
WITH
This passes results from one query part to
the next. Much like RETURN , but instead of
including data in the result set, it will be
passed to the following part of the query. It
transforms and aggregates results and also
separates READ and UPDATE statements.
ORDER
BY
SKIP
LIMIT:
This sorts and paginates the results.
ORDER BY friends DESC
SKIP 10 LIMIT 10
CREATE
This creates nodes and relationships with
their properties.
CREATE (p:Person),
(p)-[:KNOWS {since:
2010}]-> (me:Person
{name:"My Name"})
CREATE
UNIQUE
This fixes graph structures by only creating
structures if they do not yet exist.
Search WWH ::




Custom Search