title: Recursively creating a JSON tree structure from arrays of objects
body: <p>Here is my data structure:</p>
  
  <pre><code>{ projects: [
        { revisions: [
              { files: [] },
          ],
        }
    ],
    user: {}
  }
  </code></pre>
  
  <p>Go to the jsFiddle here:  <a href="http://jsfiddle.net/winduptoy/EXdDy/" rel="nofollow">http://jsfiddle.net/winduptoy/EXdDy/</a></p>
  
  <p><p>I'm tyring to recursively create a JSON hierarchy structure of an object's parents and their <code>id</code>s.  Check your console.  Look at <code>projects[0].revisions[0]._idTree</code>, which contains the <code>projects._id</code> and <code>revisions</code> as a <strong><em>child</em></strong> of <code>projects</code>, just as expected.  Now look at <code>projects[0].revisions[0].files[0]._idTree</code>, which contains <code>projects.files</code> as a <strong><em>sibling</em></strong> of <code>projects.revisions</code>, when <code>files</code> should be a <strong><em>child</em></strong> of <code>projects.revisions</code>.  How do I fix this?</p>