Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-10-2020 08:42 AM
Im trying to filter based on a list that will be applicable to a general filter as long the list has the properties of the node, its trying to filter for.
UNWIND [{id:'1002',name:'Ford', type:'4-wheel'}] as row
MATCH (c:Car)
WHERE c[head(keys(row))]=row[head(keys(row))]
return c
My problem is that the query filters as OR boolean and not AND boolean. (i.e. the reults return any combination of the property of node). However I just want the node that has all the properties listed.
06-11-2020 12:07 AM
Try this:
UNWIND [{id:'1002',name:'Ford', type:'4-wheel'}] as row
MATCH (c:Car) where exists(c.id) and exists(c.name) and exists(c.type)
and c.id = row.id and c.name = row.name and c.type = row.type
return c
06-11-2020 12:17 AM
The query u gave will achieve what im asking but this is hard coding the values. I am looking for a more dynamic/general approach that will work with other nodes. So this will work for all filters as long what is in the list is the property of the node you are trying to filter.
All the sessions of the conference are now available online