怎么判断空值
unwind [‘X’] as idkey1
optional match(n:corpid{corpid:idkey1})
with idkey1,
[n.corpid+":"+case when n.corpname is null then ‘’ else n.corpname end] as use_code
with idkey1
,case when use_code IS null then [] else apoc.coll.toSet(use_code) end as use_code_res
return
idkey1,use_code_res
;
±----------------------+
| idkey1 | use_code_res |
±----------------------+
| “X” | [NULL] |
±----------------------+
这里的 判断了use_code是否是空,但是最后还是返回[NULL] ,想要的结果[]