my query below returns "Success" string if node n successfully matched. In case it was not matched, the output is "(no changes, no records)" while I expect the query to return "Failure" string. I guess this is to do with node n not existing and therefore 'with value.rslt' is also not existing which returns nothing. How can I get "Failure" return in case node n not matched? Thank you
match(n:device) where n.nid = 'non-existing'
CALL apoc.do.case(
[
n is not null, "return 'Success' as rslt"
],
"return 'Failure' as rslt",
{n:n}
) yield value
with value.rslt as rslt
return rslt