定义 Cypher 版本
可以通过在查询前添加 CYPHER [version] 显式定义要在查询中使用的 Cypher® 版本。例如
CYPHER 5
MATCH (this0)
RETURN this0
要在查询开头添加 Cypher 版本,请将参数 cypherVersion 传递给 .build。可能的取值为 "5" 和 "25"
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
请注意,此设置仅在查询前添加 CYPHER 语句,查询本身保持不变。