1

I'm looking to make a cypher query which finds all outgoing relationships from node, excluding a couple. Here's an example:

START node=node(5), excludeRels=rel(7,8,9)
MATCH node-[rels]->x
RETURN rels

But I would like to exclude the rels in excludeRels from the returned rels. So if node(5) has outgoing relationships 6,7,8,9 and 10, I would like 6 and 10 to be returned.

Is this possible?

4

2 回答 2

3

万一其他人想知道,我发现上述问题的答案是:

START node=node(5), excludeRels=rel(7,8,9)
WITH node, collect(excludeRels) as erels
MATCH node-[rel]->()
WHERE NOT rel IN erels
RETURN rel
于 2013-04-15T11:15:03.397 回答
0

这也应该有效

START node=node(5), excludeRels=rel(7,8,9)
MATCH node-[rel]->()
WHERE rel <> excludeRels
RETURN rel
于 2013-04-15T11:28:05.847 回答