title: Efficiently check if there is at least one relationship of type connected to node, if not - remove node
body: <p>Let's assume this <code>Neo4j</code> data construct. </p>
  
  <p><code>(:Store)&lt;-[:FROM]-(:Notification)-[:FOR]-&gt;(//users//:User)</code></p>
  
  <p>Which should serve as, for example, a notification for users on a new sale in a store.<br>
  Such a notification may be addressed to a large number of users simultaneously, in this case I can see two approaches for this data modelling:</p>
  
  <ol>
  <li>Create separate <code>:Notification</code> with relationships for each of the <code>:User</code>'s; All connected to single <code>:Store</code> node. So when notification is received - relationships and <code>:Notification</code> node is removed.</li>
  <li>Approach which i thought should be more effective performance wise and about which my question is: Create a single <code>:Notification</code> node connected to a store and multiple <code>[:FOR]</code>'s for different users. Notification received - <code>:FOR</code> for this user removed, if no <code>:FOR</code>'s left - <code>:Notification</code> itself removed .</li>
  </ol>
  
  <p>So my questions are:<br>
  Am I correct in assuming that the 2nd one is a better practice?<br>
  How can I generally, after deleting a relationship, check if there are more such relationships, and do it without making Neo4j match all connected ones of this type, i.e check if there is at least one relationship of this type left?</p>