Suppose you have the following query:
OPTIONAL MATCH (a:A)-[aff:AFFECTS]->(prd:Product { name:"name1" })
WHERE aff.versionStart <= "10.1.1" <= aff.versionEnd
RETURN a
This works fine, but my problem is that I don't always have the versionEnd property, so in those cases I would like to just check for aff.versionStart <= "10.1.1", meanwhile if it exists then check for aff.versionStart <= "10.1.1" <= aff.versionEnd. Is there any way of achieving this behavior?
Cause I know I can use IS NOT NULL to check if it exists, but I haven't figure out how I can say "if it's not null, then use it, otherwise skip it"