请教如何返回虚拟关系中的属性
发布于 5 年前 作者 commissarster 1808 次浏览 来自 问答

我使用了apoc.create.vRelationship创建虚拟关系,但是此关系的属性一直无法返回或使用,请问有人用过吗?为什么创建的虚拟关系中的属性都取不出来?

MATCH (a)-[r]->(b)
WITH head(labels(a)) AS l, head(labels(b)) AS l2, type(r) AS rel_type, count(*) as count
CALL apoc.create.vNode([l],{name:l}) yield node as a
CALL apoc.create.vNode([l2],{name:l2}) yield node as b
CALL apoc.create.vRelationship(a,rel_type,{count:count},b) yield rel
RETURN rel.count;

运行结果如下

╒═══════════╕
│"rel.count"│
╞═══════════╡
│null       │
├───────────┤
│null       │
├───────────┤
│null       │
├───────────┤
│null       │
└───────────┘

这里返回null很奇怪,有人遇到 过吗? 我使用的neo4j是3.5.0,apoc是3.5.0.1

回到顶部