title: i wanto get a result set of neo4j as an json?
body: <p>currently i am doing is represent relation ships of data using d3.js. need to represent it in a tree. My data stored at Neo4j server. And application is design under Express frame work.</p>
  
  <pre><code>var cypher = [
                  "match (b:Binary)-[r*..1]-&gt;(a:Binary)",
                      "where a.Key = '" + data + "'",
                  "return collect( distinct b) as dep"].join("\n");
  </code></pre>
  
  <p>execute this query and put the result in to a queue and sequentially execute it. this is for getting all children of the node. But I need to make this not as flat json something like depth. like `</p>
  
  <pre><code>{
   "name": "flare",
   "children": [
    {
     "name": "analytics",
     "children": [
      {
       "name": "cluster",
       "children": [
        {"name": "AgglomerativeCluster", "size": 3938},
        {"name": "CommunityStructure", "size": 3812},
        {"name": "HierarchicalCluster", "size": 6714},
        {"name": "MergeEdge", "size": 743}
       ]
      },
  ......  how can i do it?
  </code></pre>