Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-14-2018 09:37 AM
Hi!
I was trying to conditionally set a key using apoc.map.setKey
but am not getting it to work.
How would I go about doing something like
if value.selection is not null
apoc.map.setKey(n, 'who', {filter: value.selection, type: type})
Any hints would be very much appreciated!
Nikolai
Solved! Go to Solution.
10-20-2018 07:06 PM
You can use WHERE for a general filter or perhaps CASE
WITH CASE value.selection WHEN null THEN map ELSE apoc.map.setKey(map, 'who', {filter: value.selection, type: type}) END as map
10-20-2018 07:06 PM
You can use WHERE for a general filter or perhaps CASE
WITH CASE value.selection WHEN null THEN map ELSE apoc.map.setKey(map, 'who', {filter: value.selection, type: type}) END as map
11-24-2018 12:06 PM
Thanks a lot! This works well!
All the sessions of the conference are now available online