title: Which database can handle deeply nested objects?
body: <p>I want to get object like this:</p>
  <pre><code>[
    {
      label: &quot;first&quot;,
      id: 1,
      children: []
    },
    {
      label: &quot;second&quot;,
      id: 2,
      children: [
        {
          label: &quot;third&quot;,
          id: 3,
          children: [
            {
              label: &quot;fifth&quot;,
              id: 5,
              children: []
            },
            {
              label: &quot;sixth&quot;,
              id: 6,
              children: [
                {
                  label: &quot;seventh&quot;,
                  id: 7,
                  children: []
                }
              ]
            }
          ]
        },
        {
          label: &quot;fourth&quot;,
          id: 4,
          children: []
        }
      ]
    }
  ];
  </code></pre>
  <p>Is this kind of database design possible? Which database should I learn to get this result or should I change the database design?</p>
  <p>I want to do 1 HTTP request then get all data by specific ID and its children so if I want to get id 3, I just need to get it and its children. I'm using MongoDB but I think it's complicated. I can only get results by finding the root data, then do JavaScript looping to get its child.</p>