I need a query that checks if a node exists, a specific attribute on that node exists and post-process the result using case or something.
Ex:
CALL apoc.cypher.run("OPTIONAL MATCH (n:Location{SureName:'9144735079d813886326'}) RETURN CASE n.SubType WHEN null THEN 'Location was not loaded' ELSE n.SubType END AS result UNION OPTIONAL MATCH (n:Location{SubType:'Site',SureName:'914473507981388d6326'}) RETURN CASE n.SubType WHEN null THEN 'NotLoaded' ELSE n.SubType END as result", null) YIELD value AS rv
But I want to be able to return just one string depending on the results that I get.
Thanks.