I want to use the results from the first query in the second query. I am not sure how to do this in Cypher?
Current code,
START user1=node:USER_INDEX(USER_INDEX = "userA")
MATCH user1-[r1:ACCESSED]->docid1<-[r2:ACCESSED]-user2, user2-[r3:ACCESSED]->docid2
WHERE r2.Topic=r3.Topic
RETURN distinct docid2.Label;
I want to have different conditions checked in the WHERE clause for the same docid2 set of nodes and accumulate the results and perform order by based on a date field. I am not able to provide multiple match and return within the same transaction. That is when I am trying to have two different cypher scripts and combine them in a third query. Is this possible in cypher? Or is there any option to write custom functions and invoke them? Do we have stored Cypher scripts like Stored Gremlin scripts?