I try to merge nodes if two different statements are true. I work with twitter data and I want to merge tweets if the Text of the tweet and the id of the creator is the same. How can I do a collection of that? I know how to collect data where one attribute is the same:
WITH f.Text as Text, collect(f) as nodes
WHERE size(nodes) > 1
but I am not sure how I can get the second MATCH into that.
I hope someone can help
I don't have that much time but this link would help you a bit as a non pure Cypher solution:
WITH DISTINCT tw.text AS text, tw.id AS id, collect(tw) AS nodes <- This line create a list of tweets that have the same unique text and id properties pair
CALL [Replace this with the apoc procedure]
Cypher by itself without APOC is not optimise to refactor a graph at this scale. It's better to avoid these situations by creating CONSTRAINTS before importing or creating data.