替代关系已弃用警告 [英] alternative relationship deprecated warning

查看:76
本文介绍了替代关系已弃用警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

密码查询:

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浏览器中运行它会导致警告:

Running it in Neo4j browser results in a warning:

**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.

如何重新编写此查询以消除此警告?

How can I re-write this query to eliminate this warning?

提前谢谢.

推荐答案

此弃用不在于无法使用关系类型替代项,而在于其语法–请参见

This deprecation is not about inability of using relationship type alternatives but about its syntax – see cypher deprecations in version 3.2. Only first type has colon now, i.e. not :R1|:R2 but :R1|R2. Deprecation warning in Neo4j browser suggests that former syntax will have new semantics in the future.

在模式中指定关系类型实际上比事后过滤路径有效得多,这是执行汤姆·盖登斯的变通方法.

Specifying relationship type in a pattern is actually much more effective than filtering paths ex-post which is the way that the workaround by Tom Geudens is executed.

这篇关于替代关系已弃用警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆