I am building a Query for cypher using Neo4jClient base on User search term. my question is how can i load all the related nodes to first node that i am searching for.
here is a code sample in neo4jclient :
q.Return(post => post.As<Post>()).OrderBy("post.creationDate");
which produce something like this in cypher but without the result part:
MATCH (post:Post)-[:HAS_MentionedUsers]->(assignee1307989068:User),(post:Post)-[:HAS_HashTags]-> (Hashtag1841024507:HashTag)
WHERE (assignee1307989068.UserName = "mhs")
OR (Hashtag1841024507.Value = "myTag")
I am searching for the post but i need all the related node to Post to be included in the result set.
Make sure to have indexes for :User(UserName) and :HashTag(Value)
You create a cross product here, not sure that you want this, probably a union is better
You can just expand the pattern to contain other relationships off :Post too.