WHERE p.accountGUID = 'xxxxxxxxxx' AND NOT c.id IN ['76','1330', '65','1402', '1152','64','59']
Products are being returned from the above query that DO have relationships with categories from the collection that should be filtered out. Am I misunderstanding how the WHERE NOT IN clause works with respect to relations?
Any help or explanation is appreciated! Thank you!
Could it be that p is associated with other categories that are not in the list. In that case this would return that p even though it might be associated with the categories provided in the list as there is a path.
In this case there is MATCH for category id 75 that is returned. So, you will get that p node returned.
If you don't want any p returned if that is associated with the specified categories irrespective of other connections then query should be like this
WHERE p.accountGUID = '1234'
WITH p, collect(c.id) as categories
WHERE none( x in categories WHERE x in ['76','1330', '65','1402', '1152','64','59'] )