I have a simple problem, having a model like this:
(User)-[r_like:USER_LIKES_DECK]->(Deck)
Where relationship r_like has property like = TRUE | FALSE to distinguish between like and dislike.
Now I need to return like and dislike count for each deck. How to achieve this?
Dummy pseudo code:
MATCH (d:Deck)
OPTIONAL MATCH (d)<-[r:USER_LIKES_DECK]-(u:User)
WITH d, count(r) WHERE r.like = true AS likedCount, count(r) WHERE r.like = false AS dislikedCount // <- NOT WORKING
RETURN d{.*, likedCount:likedCount, dislikedCount:dislikedCount}