PONPON
(Kobayashi Takanori)
1
I'm developing an article recommendation system. When a user read article1, article2, ..., and articlen, the system recommend next articles.
I want to do something like the following:
MATCH (a:Article)
WHERE {for all x such that (x:Article)-[:next]->(a:Article), x.read=true}
RETURN a
How do I write this?
Hi Kobayashi,
You can use Optional Match
match(a:Article)
optional match (x:Article)-[:next]->(a:Article) set x.read=TRUE return x
ameyasoft
( Ameyasoft)
3
This query is going to set read = true flag for all users. You need to select the articles read by a user and set the flag to true for that user.