密码查询:
MATCH (x) WHERE x.uuid = "41f64ab1-6009-4e95-b22b-c833525f6edb" MATCH p =
(o)-[:CONTAINS|:HAVING*]->(x) WHERE labels(o) IN ['Box', 'Package'] RETURN p
在 Neo4j 浏览器中运行它会产生警告:
**WARNING: This feature is deprecated and will be removed in future versions.**
The semantics of using colon in the separation of alternative relationship
types in conjunction with the use of variable binding, inlined property
predicates, or variable length will change in a future version.
如何重写此查询以消除此警告?
提前致谢。
这种弃用并不是因为无法使用关系类型替代方案,而是因为它的语法 – 请参阅3.2 版本中弃用了 cypher https://neo4j.com/docs/developer-manual/current/cypher/deprecations-additions-removals-compatibility/#cypher-deprecations-additions-removals-3.2。现在只有第一种类型有冒号,即没有:R1|:R2
but :R1|R2
。 Neo4j 浏览器中的弃用警告表明以前的语法将来将具有新的语义。
在模式中指定关系类型实际上比事后过滤路径更有效,这是 Tom Geudens 的解决方法的执行方式。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)