Define Cypher version
It is possible to define the version of Cypher® to use in a query by prepending that query with CYPHER [version]. For example:
CYPHER 5
MATCH (this0)
RETURN this0
To add the Cypher® version at the beggining of the query, pass the parameter cypherVersion to .build:
const movieNode = new Cypher.Node();
const pattern = new Cypher.Pattern(movieNode, { labels: ["Movie"] });
const matchQuery = new Cypher.Match(pattern)
.where(movieNode, {
title: new Cypher.Param("The Matrix"),
})
.return(movieNode.property("title"));
const { cypher } = matchQuery.build({
cypherVersion: "5",
});
CYPHER 5
MATCH (this0:Movie)
WHERE this0.title = $param0
RETURN this0.title
Note that this setting only prepends the CYPHER statement to the query.
The query itself is unchanged.