Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-20-2018 04:22 AM
Return COLLECT({type:labels(t), id:t.userid,id:t.teamid}) as tagged
Here based on label type can we make id parameter in dynamic in collection result?
Like if type = User then id:t.userid
if type = Team then id:t.teamid
Solved! Go to Solution.
09-20-2018 05:44 AM
You can use CASE here to do this:
RETURN collect({type:labels(t), id: CASE WHEN t:User THEN t.userid ELSE t.teamid END}) as tagged
Alternately you can use coalesce() to get the first non-null result:
RETURN collect({type:labels(t), id: coalesce(t.userid, t.teamid)}) as tagged
09-20-2018 05:44 AM
You can use CASE here to do this:
RETURN collect({type:labels(t), id: CASE WHEN t:User THEN t.userid ELSE t.teamid END}) as tagged
Alternately you can use coalesce() to get the first non-null result:
RETURN collect({type:labels(t), id: coalesce(t.userid, t.teamid)}) as tagged
All the sessions of the conference are now available online