title: How to reset / clear / delete neo4j database?
body: <p>We can delete all nodes and relationships by following query.</p>
  
  <pre><code>MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r
  </code></pre>
  
  <p>But newly created node get internal id as ({last node internal id} + 1) . It doesn't reset to zero.</p>
  
  <p>How can we reset neo4j database such as newly created node will get id as 0?</p>
  
  <p>From 2.3, we can delete all nodes with relationships,</p>
  
  <pre><code>MATCH (n)
  DETACH DELETE n
  </code></pre>