You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2021. It is now read-only.
I am using neo4j-graphql-js and in one of my cypher statement's I'm referring to "this" which is the current node. It seems that the word "this" in my first MATCH is accurate, but then when I use MATCH the second time, "this" becomes just a general keyword and defaults to an unlabeled/non-specific node (and just returns everything).
Here's the code currently. it finds any posts that are either tagging "Things" that are children of the current Thing node, or where they're tagging the current Thing node specifically.
MATCH (this)<-[:CHILD_OF]-(t1:Thing)<-[:TAGGED]-(post:Post)
WITH COLLECT(post) as rows
MATCH (this)<-[:TAGGED]-(p:Post)
WITH rows + COLLECT(p) as allRows
UNWIND allRows as post
RETURN count(DISTINCT post)
Any ideas how I can reuse "this" the second time? I tried sharing it after WITH COLLECT(post) as rows, like this:
WITH COLLECT(post) as rows, this
Any ideas would be appreciated, thank you in advance!