The following sections describe some of the other supported features.
Apart from comparison and concatenation operators openCypher provides special string operators for easier matching of substrings:
|Returns true if prefix of string a is equal to string b.|
|Returns true if suffix of string a is equal to string b.|
|Returns true if some substring of string a is equal to string b.|
When automating the queries for Memgraph, it comes in handy to change only some parts of the query. Usually, these parts are values which are used for filtering results or similar, while the rest of the query remains the same.
Parameters allow reusing the same query, but with different parameter values.
The syntax uses the
$ symbol to designate a parameter name. We don't allow
old Cypher parameter syntax using curly braces. For example, you can parameterize
filtering a node property:
You can use parameters instead of any literal in the query, but not instead of property maps even though that is allowed in standard openCypher. Following example is illegal in Memgraph:
To use parameters with Python driver use following syntax:
To use parameters which names are integers you will need to wrap parameters in a dictionary and convert them to strings before running a query:
To use parameters with some other driver please consult appropriate documentation.
Conditional expressions can be expressed in openCypher language by simple and
generic form of
CASE expression. A simple form is used to compare an expression
against multiple predicates. For the first matched predicate result of the
expression provided after the
THEN keyword is returned. If no expression is
matched value following
ELSE is returned is provided, or
ELSE is not
In generic form, you don't need to provide an expression whose value is compared to predicates, but you can list multiple predicates and the first one that evaluates to true is matched:
PROFILE operators can be used to inspect and profile a
particular Cypher query in order to see its internal representation and the
way it behaves during execution.
For a detailed look at using
PROFILE, take a look at the guides: