I am loading a data set with some missing values. E.g. :Person node always has idNumber, but is sometimes missing dob. I create all the nodes without issues and I have confirmed that there are nodes that have both idNumber and dob and nodes that have idNumber only. The number of loaded nodes matches the number of rows in the input files. Then I try to create a relationship between :Membership and :Person based on memberId and idNumber only:
USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM 'file//my_file.csv' AS row
WITH row
WHERE row.idNumber IS NOT NULL
MERGE (person:Person {idNumber: row:idNumber})
MERGE (membership:Membership {memberId: row.memberId})
CREATE (person)-[:IS_MEMBER]->(membership)
The above statement works only if I load nodes WITHOUT dob property. If nodes have dob property. no relationships are created, even for the nodes that have both idNumber and dob populated. I attempted
MERGE (membership:Membership {memberId: row.memberId, dob:row.dob})
which also failed. How do I create relationships based on a single property? (e.g. I don't care if dob property is present in the node or not, I want to create a relationship based on idNumber and membership ID)