cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Checking Lists Within Lists

dbeaumon
Node Link

I'm pretty sure that I've done this before, but my internet brain is not being useful today.

I need to do something like this:

WITH ("a","b","c") AS master_list
MATCH (thing:Thing {ID: "test"})-[:HAS]->(anotherthing:Thing)
WITH master_list, thing, collect(anotherthing.ID) as thinglist
// Continue with just things where NO entries in thinglist are in master_list

I know this can be done, but I'm having an aged moment

Thanks,

Dave

1 REPLY 1

dbeaumon
Node Link

Never mind...

WITH ("a","b","c") AS master_list
MATCH (thing:Thing {ID: "test"})-[:HAS]->(anotherthing:Thing)
WITH master_list, thing, collect(anotherthing.ID) as thinglist
WHERE NONE (i in thinglist where i in master_list)

I do think that this should be an example in the predicates section of the cheat sheet though...