简体   繁体   English

Neo4j密码查询-如何获取特定标签数据?

[英]Neo4j cypher Query - How to get specific labels data?

I want to get only customer and supplier name and ID using cypher query. 我想使用密码查询仅获取客户和供应商名称和ID。

"Match (n: customer:supplier) where has (n.ID) return n.ID,n.nme";

How to combine 2 labels to get the data? 如何结合两个标签来获取数据?

Above query is getting syntax error. 上面的查询获取语法错误。 Please advise. 请指教。

This for OR label matching: 这用于OR标签匹配:

MATCH (n) 
WHERE (n:customer OR n:supplier) AND exists(n.ID)
RETURN n.ID, n.nme

This for AND label matching: 这用于AND标签匹配:

MATCH (n:customer:supplier) 
WHERE exists(n.ID)
RETURN n.ID, n.nme

The has() function has long since been deprecated and removed. has()函数早已被弃用并删除。 Use exists() instead. 改用exists()

Also I'm not sure what you mean by combine 2 labels to get the data. 此外,我不确定combine 2 labels to get the data.是什么意思combine 2 labels to get the data. The query as it is now will only match to nodes with both the :customer and :supplier label. 现在的查询将只与同时带有:customer和:supplier标签的节点匹配。 Is that what you want? 那是你要的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM