在Neo4J中查找具有相同属性的节点 [英] Find Nodes with the same properties in Neo4J

查看:1601
本文介绍了在Neo4J中查找具有相同属性的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Neo4J中有两个数据集.我想在这两个数据集中具有相同特定属性的所有节点.这是使用Cypher代码.

I have two datasets in Neo4J. I would like to find all nodes within these two datasets that have the same particular property. This is using Cypher code.

我当前正在使用:

MATCH n=node(*), m=node(*)
WHERE (n.name) AND (m.name) AND 
  n.name=m.name 
RETURN n, m

希望获得显示所有具有相同name的节点的结果.

In the hope to get a result showing all nodes with the same name.

我知道这条2013年的旧帖子: neo4j查找具有以下条件的所有节点匹配属性

I am aware of this old 2013 post here: neo4j find all nodes with matching properties

但是自该日期以来,Cypher代码已得到重大更新.

But the Cypher code has been significantly updated since this date.

任何帮助都将非常感谢.

Any help would be great thanks.

推荐答案

Neo4j中没有表

create index on :LabelA(propertyA);
create index on :LabelB(propertyB);

MATCH (a:LabelA)
MATCH (b:LabelB)
WHERE b.propertyB = a.propertyA
RETURN a,b;

这篇关于在Neo4J中查找具有相同属性的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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