我正在使用 Java API,并且正在寻找具有标签子集的节点。在 cypher 中,我使用这个查询:
Match(n) 其中 n:label1 OR n:label2 返回 n
那么,api中有没有什么方法可以做到这一点?
谢谢
最佳答案
您实际上可以运行嵌入的 Cypher 查询,那为什么还要跳舞呢?
try (
Transaction vTx = graphdb.beginTx();
Result vResult = graphdb.execute("your cypher query here");
) {
while (vResult.hasNext()) {
Map<String, Object> vRecord = vResult.next();
// process vRecord here
}
vResult.close();
vTx.success();
}
希望这有帮助。
问候, 汤姆
关于java - 如何在 Neo4j Embedded 中查找具有标签子集的节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45751340/