title: In neo4j, can I directly create another database according to a query result?
body: <p>For example, I have this query to get length of all pair shortest path:</p>
  <pre><code>MATCH (p:Person)
  WITH collect(p) as nodes
  UNWIND nodes as n
  UNWIND nodes as m
  WITH n, m WHERE id(n)&lt;id(m)
  MATCH path = shortestPath((n)-[*..6]-(m))
  WHERE apoc.coll.duplicates(NODES(path)) = []
  RETURN length(path) AS len
  </code></pre>
  <p>Can I create another database which has the same nodes, but has relationship <code>(x)-[has_path]-&gt;(y)</code> with relationship property <code>len</code> by Cypher?
  I know I can use an external program (Python, Java, etc) to run this Cypher, catch and temporary store the results and then create the new database. I just wonder can this be done directly by Cypher even not temporary storing results to the original database?</p>