title: How to get a subdocument with a populate in mongoose
body: <p>I configuring an api similar to the blog category.</p>
  <p>The object ID of the category is recorded for each post.</p>
  <p>Please help us with how we can extract data in the form of the third image.</p>
  <ul>
  <li>first code: category data</li>
  <li>second code : post data ( category object id value )</li>
  <li>third code : the result that I want</li>
  </ul>
  <br>
  <pre><code>{ // category
      _id: '61dd8eb5368930c3a6cee140',
      name: 'parent',
      childern: [
          { _id: '61dd8eb5368930c3a6cee141',
            name: 'child1' },
          { _id: '61dd8eb5368930c3a6cee142',
            name: 'child2' }
      ]
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/9ayRX.png" rel="nofollow noreferrer">first code</a></p>
  <br>
  <pre><code>{ // post data
      _id: '61dd8eb5368930c3a6cee160',
      name: 'first post - parent',
      category: '61dd8eb5368930c3a6cee140',
  },
  {
      _id: '61dd8eb5368930c3a6cee161',
      name: 'second post - child',
      category: '61dd8eb5368930c3a6cee141',
  },
  </code></pre>
  <p><a href="https://i.stack.imgur.com/u159s.png" rel="nofollow noreferrer">second code</a></p>
  <br>
  <pre><code>{ // the result that I want
      _id: '61dd8eb5368930c3a6cee160',
      name: 'first post - parent',
      category: {
          _id: '61dd8eb5368930c3a6cee140',
          name: 'parent'
      }
  },
  {
      _id: '61dd8eb5368930c3a6cee161',
      name: 'second post - child',
      category: {
          _id: '61dd8eb5368930c3a6cee141',
          name: 'child1'
      }
  },
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SukTL.png" rel="nofollow noreferrer">third code</a> == i want it</p>
  <p>pleas help me</p>