depends on what you look at: More or less:
merge: - for node: check if node exists either via index or constraint lookup, if there is a constraint it also takes a lock, if it doesnt exist create it and add to index/constraint - for rel: with 2 bound nodes - check if the given rel-type (and properties) exist between the nodes, if not create - with one bound node - check if rel with type and properties exists to a node with the given label and properties (not globally but locally) create unique (deprecated) - go from all bound nodes step by step an check if the given rels (type + properties) exist to the give nodes (label + properties) if they do continue otherwise create and continue Michael On Thu, Aug 7, 2014 at 5:02 PM, Nikolay Artamonov <[email protected]> wrote: > Good question, sad to see no one gave solid answer :( I have the same > problem with understanding difference between MERGE and CREATE UNIQUE. > Manual doesn't provide good explanation. > > пятница, 3 января 2014 г., 1:53:14 UTC+4 пользователь Javad Karabi написал: > >> can anyone explain what MERGE and CREATE UNIQUE do, in pseudocode? >> im having trouble understanding exactly the order in which one or the >> other will decide to create a new relationship, or use a new one. >> for example, CREATE UNIQUE will try to use as much of the graph as >> possible, does this mean it attempts to match each node on the other side >> of a relationship, prior to create the node? >> > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
