kratsg / cloudchaser

Soundcloud artist recommendation tool
0 stars 0 forks source link

Weighted stuff #7

Open kratsg opened 8 years ago

kratsg commented 8 years ago

http://stackoverflow.com/questions/20054228/how-to-check-if-an-element-is-in-a-node-collection-using-cypher

http://neo4j.com/docs/2.1.5/cypher-refcard/

kratsg commented 8 years ago
MERGE (n:Person {id: 113493922})
ON CREATE SET n.ids = []
ON MATCH SET n.ids = CASE WHEN NOT (HAS (n.ids))
  THEN [1234]
  ELSE CASE WHEN NOT 1234 in n.ids
    THEN n.ids + [1234]
    ELSE n.ids
  END
END
RETURN n