title: Why multiple nodes are created in Neo4j by CREATE or MERGE query
body: <p>I'm using <code>Cypher</code> to create some data in <code>Neo4j</code>. It's a pretty straight forward product model, with following elements</p>
  
  <ol>
  <li>Product (e.g. a mobile)</li>
  <li>Features (e.g. quick charge)</li>
  <li>Related products (e.g. tampered glass)</li>
  <li>Outlets (e.g. local store, related products are sold through outlets)</li>
  </ol>
  
  <p>I have written some query to insert the data. What it <em>tries to do</em> is</p>
  
  <ul>
  <li>Create a product</li>
  <li>Create a feature set</li>
  <li>Link product with feature [:HAS_FEATURES]</li>
  <li>Create outlets x3</li>
  <li>Create related product 1</li>
  <li>Link product to related product [:HAS_RP], and related product to all outlets [:SOLD_THROUGH]</li>
  <li>Create related product 2</li>
  <li>Link it to product &amp; outlets like above</li>
  </ul>
  
  <p>Below is the actual query</p>
  
  <pre><code>//Product
  CREATE (p:Product {name: 'Cool Mobile YX Plus',
    key: 'MOB0001',
    version: 'X.1'
  }),
  
  //Features
  (f:Features {hasQuickCharge: true,
    isAvailable: true,
    hasVolte: false
  })
  
  MERGE (p) -[:HAS_FEATURES]-&gt; (f)
  
  //Outlets (:Product level lookup)
  CREATE (o1:Outlet {productType: 'New', seller: 'National_Shops', prId: 'MOB0001'})
  CREATE (o2:Outlet {productType: 'New', seller: 'Local_Shops', prId: 'MOB0001'})
  CREATE (o3:Outlet {productType: 'New', seller: 'Online_Shops', prId: 'MOB0001'})
  
  //Related products
  CREATE (rps1:RPS {rpId: 'TGS1108',
    rpName: 'YX Plus Tampered Glass',
    price: 180.99
  })
  WITH rps1
  MATCH (ol1:Outlet {productType: 'New', prId: 'MOB0001'})
  MATCH (pr1:Product {key: 'MOB0001'})
  MERGE (pr1) -[:HAS_RP {typeName: 'Child'}]-&gt; (rps1)
  MERGE (rps1) -[:SOLD_THROUGH]-&gt; (ol1)
  
  CREATE (rps2:RPS {rpId: 'CVR0204',
    rpName: 'YX Plus back cover',
    price: 299.00
  })
  WITH rps2
  MATCH (ol2:Outlet {productType: 'New', prId: 'MOB0001'})
  MATCH (pr2:Product {key: 'MOB0001'})
  MERGE (pr2) -[:HAS_RP {typeName: 'ChargeFor'}]-&gt; (rps2)
  MERGE (rps2) -[:SOLD_THROUGH]-&gt; (ol2)
  </code></pre>
  
  <p>Now the problem is, the <strong>second related product is created 3 times</strong>, where it was expected to be created only once, just like the first related product.</p>
  
  <p>Can anyone please help me understand what I'm doing wrong? Also, any help in writing the query in better way would be great. </p>
  
  <p><a href="https://i.stack.imgur.com/S2kXo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S2kXo.png" alt="enter image description here"></a></p>