Hi,
I have :Person, :Question, and :Answer nodes. A person can either answer a question or skip it. If they answer the question, I'm adding a relationship (:ANSWERED) between the :Person node and the :Answer node. If they decide to skip it, I'm adding a relationship (:SKIPPED) between the :Person node and the :Question node. I need to find a :Question that hasn't been answered or skipped to present to the user. Right now, I'm just trying to find the ones that haven't been skipped. This is my query:
MATCH (p:Person {firstName: 'Leeland'})-[r]->(q:Question)
WHERE r IS NULL
RETURN q
I found some SO answers that claim this should work...but they're from version 2.2 (so...a bit old). I also tried using it with an OPTIONAL match...that didn't work either. It returned null.
MATCH (p:Person {firstName: 'Leeland'})
OPTIONAL MATCH (p)-[r]->(q:Question)
WHERE r IS NULL
RETURN q
I have the :Person node and two :Question nodes created. I also put a :SKIPPED relationship between the :Person and :Question node.
Any thoughts on what I'm doing wrong?