Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-11-2021 05:50 AM
Hello,
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:
MATCH (f:Tweet)
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
Best Regards,
Lars
04-11-2021 09:37 AM
Hello
I don't have that much time but this link would help you a bit as a non pure Cypher solution:
MATCH (tw)
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.
All the sessions of the conference are now available online