如何使用密码查询检索具有多个关系的节点 [英] How to retrieve the nodes with multiple relationships using cypher query

查看:38
本文介绍了如何使用密码查询检索具有多个关系的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我吗?

我正在使用密码查询来获取具有"hive"或"hadoop"关系的节点,并且能够获取这些节点.

I am using cypher query to get the nodes that are having relationship as either 'hive' or 'hadoop' and i am able to get the nodes.

但是当我尝试获取同时具有"hive"和"hadoop"关系的节点时,我无法获取这些节点.

but when i try to get the nodes that are having relationship as both 'hive' and 'hadoop' i am not able to get the nodes.

这是我正在使用的查询

开始n = node(*)匹配(n)-[r]-(),其中type(r)="Hadoop"和type(r)="hive"返回n,count(n);

start n=node(*) match (n)-[r]-() where type(r)="Hadoop" and type(r)="hive" return n,count(n);

此查询返回0行.

我的查询是错误的还是我需要用其他方式做?

Is my query wrong or do i need to do it the other way.

提前谢谢.

老鼠

推荐答案

这应该做到:

start n=node(*) match ()-[:Hadoop]-(n)-[:hive]-() return n,count(n)

这篇关于如何使用密码查询检索具有多个关系的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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