Cypher Builder
Cypher® Builder 是一个用于在 JavaScript 和 TypeScript 中构建 Cypher 查询的编程 API,适用于 Neo4j。
例如,以下代码
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, params } = matchQuery.build();
生成以下 Cypher 查询以及所需的参数
MATCH (this0:Movie)
WHERE this0.title = $param0
RETURN this0.title
|
如果您使用 Java,可以改用 Neo4j Cypher-DSL。 |