<p dir="auto">Currently making a Cypher request over the REST API  returns results as nested arrays that contain maps instead of just an array of maps.  This makes it harder to decode. I currently read the entire response and then do string replaces to fix it up before decoding it. If the format was more standard (especially if I could get the desired results shown below) I could easily do a streaming decode which would be a lot more efficient.</p>
<p dir="auto">MATCH (u:User)<br>
RETURN {name: u.name, email: u.email} AS r</p>
<p dir="auto">Actual Results</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;columns&quot;: [&quot;r&quot;],
  &quot;data&quot;:[
    [{&quot;name&quot;:&quot;foo&quot;, &quot;email&quot;: &quot;foo@bar.com&quot;}],
    [{&quot;name&quot;:&quot;bat&quot;, &quot;email&quot;: &quot;bat@bar.com&quot;}]  // note the extra brackets
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "columns": ["r"],
  "data":[
    [{"name":"foo", "email": "foo@bar.com"}],
    [{"name":"bat", "email": "bat@bar.com"}]  // note the extra brackets
  ]
}
</code></pre></div>
<p dir="auto">Expected Results</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;columns&quot;: [&quot;r&quot;],
  &quot;data&quot;:[
    {&quot;name&quot;:&quot;foo&quot;, &quot;email&quot;: &quot;foo@bar.com&quot;},
    {&quot;name&quot;:&quot;bat&quot;, &quot;email&quot;: &quot;bat@bar.com&quot;}
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "columns": ["r"],
  "data":[
    {"name":"foo", "email": "foo@bar.com"},
    {"name":"bat", "email": "bat@bar.com"}
  ]
}
</code></pre></div>
<p dir="auto">Desired results:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[
  {&quot;name&quot;:&quot;foo&quot;, &quot;email&quot;: &quot;foo@bar.com&quot;},
  {&quot;name&quot;:&quot;bat&quot;, &quot;email&quot;: &quot;bat@bar.com&quot;}
 ]"><pre class="notranslate"><code class="notranslate">[
  {"name":"foo", "email": "foo@bar.com"},
  {"name":"bat", "email": "bat@bar.com"}
 ]
</code></pre></div>
<p dir="auto">Is there any way to get to the expected or desired results with Cypher 2.0?</p>
<p dir="auto">Suppose I have this node:</p>
<p dir="auto">(n:person {name: "Bob Smith", city: "Boston"})-[:brother]-(n:person {name: "Dave Smith"})</p>
<p dir="auto">and this node:</p>
<p dir="auto">(n:person {name: "Bob Smith", haircolor: "brown"})-[:brother]-(n:person {name: "Frank Smith"})</p>
<p dir="auto">It would be great to have an automatic way of combining them, to get:</p>
<p dir="auto">(n:person {name: "Frank Smith"})-[:brother]-(n:person {name: "Bob Smith", city: "Boston", haircolor:"brown"})-[:brother]-(n:person {name: "Dave Smith"})</p>
<p dir="auto">Right now I'm doing this manually, by taking one node's properties and relationships, inserting them with MERGE into the other node, and then deleting the redundant first node, but this is clunky and requires multiple round-trips between neo4j and the server. One person suggested using MERGE to avoid duplicates, but unfortunately I can only detect them with a complex machine learning algorithm, so there's no real way to screen them out in advance.</p>
<p dir="auto">Relevant StackOverflow thread: <a href="http://stackoverflow.com/questions/23376881/neo4j-merge-2-or-multiple-duplicate-nodes" rel="nofollow">http://stackoverflow.com/questions/23376881/neo4j-merge-2-or-multiple-duplicate-nodes</a></p>