返回
本页描述如何使用 Cypher®.Return 类创建一个 RETURN 子句。
可以使用 new Cypher.Return 添加 RETURN 子句。不过,更常见的做法是先有一个已有子句(例如 MATCH),然后通过 .return 方法添加。在这两种情况下,返回的变量都可以作为参数传入。
const node = new Cypher.Node();
const returnQuery = new Cypher.Return(node, new Cypher.Literal(10));
这将生成以下的 RETURN 子句
RETURN this0, 10
任何表达式都可以作为返回值传入,例如函数
const returnQuery = new Cypher.Return(Cypher.round(new Cypher.Param(2.3)));
这相当于
RETURN round($param1)