I'm trying to return content nodes based on terms that the user has selected. The following is my cypher query as it is:
MATCH
(content:content)-[:TAGGED_WITH]-(term:term)
WHERE
term.UUID IN {includedTerms}
AND NOT term.UUID IN {excludedTerms}
RETURN DISTINCT content.whatever
Where {includedTerms}
is an array of UUIDs for the terms to be included.
The problem is that it is returning content connected to any of the included term nodes rather than content that is connected to each of the included term nodes.
I realize that the query is returning exactly what I'm telling it to. The question is how can I specify that the content must be tagged with every (and not any) of the term nodes that the user has selected?
Thanks a lot- let me know if there is any needed clarification.