I have the same problem for some Cypher queries I'm implementing. I think that my approach is wrong, but I'm trying to understand how to solve the problem.
I have a problem with those queries with non existent properties or null values.
A simple example starting from a working query:
MATCH (entity:XmlTag) WHERE entity._name="orm_EntityType" RETURN DISTINCT entity.id, entity.Name, entity._ReferenceMode, entity.IsIndependent
This query is fine, it returns the exact number of rows.
If I modifiy the query as follows:
MATCH (entity:XmlTag) MATCH (dataType:XmlTag) WHERE entity._name="orm_EntityType" AND dataType._name="odt_dataType" AND dataType.name=entity._ReferenceMode RETURN DISTINCT entity.id, entity.Name, entity._ReferenceMode, entity.IsIndependent, dataType.id
I only got a subset of the previous result, but I want to display all of them and in case the new condition is not satisfied (wheter dataType is null or not existent) I want to show the same rows as before, but with null values.
Here, instead of null, the expected rows are not showed.
I've tried to play with NULL, but nothing changed.
Probably my approach is not correct.
Could you please suggest a solution?
Thanks in advance.