Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-08-2020 10:07 AM
Hi,
I need to know, how can get all the matching records and non matching record by passing query params from nodejs.
i want result something like if file exists then
[{
name: 'p1.pdf',
exist: true
},
{
name: 'p2.pdf',
exist: true
},
{
name: 'p3.pdf',
exist: false
}
]
unwind [{name: 'p1.pdf' },{name: 'p2.pdf'} , {name: 'p3.pdf'}] as r
match (f:file) where f.name = r.name
return collect({name: f.name, exist: exists(f.name)})
for 3 records it should 3 records only. else i have to loop one by one via nodejs.
I don't know how to return item which are not matched in neo4j. could anyone please explain and guide?
Regards
Meet
Solved! Go to Solution.
04-09-2020 11:41 PM
Ah.. typo mistake
unwind $clist as c match(n:file) With Case when c in collect(distinct n.name) Then c+' exists' else c+' does not exist' end as rlist return collect(rlist)
04-09-2020 06:09 AM
Try below
:param clist =>['a','b','x','y']
unwind $clist as c match(n:file) return Case when c in collect(distinct n.name) Then c+' exists' else c+' does not exist' end
04-09-2020 07:58 AM
thanks vivek. it not giving me array of objects
04-09-2020 08:05 AM
unwind $clist as c match(n:file) return With Case when c in collect(distinct n.name) Then c+' exists' else c+' does not exist' end as rlist return collect(rlist)
04-09-2020 10:27 PM
its not working. giving error because of 2 returns
04-09-2020 11:41 PM
Ah.. typo mistake
unwind $clist as c match(n:file) With Case when c in collect(distinct n.name) Then c+' exists' else c+' does not exist' end as rlist return collect(rlist)
All the sessions of the conference are now available online