title: is there a way to fetch only a deeply nested subdocument in mongoose by id?
body: <p>here is what my document looks like</p>
  <pre><code>{
      &quot;_id&quot; : ObjectId(&quot;5d9df11b0e0a6e032bf3117f&quot;),
      &quot;body&quot; : ...
       ...
      &quot;comments&quot; : [            
          {
              &quot;comment&quot; : ..,
              &quot;_id&quot; : ObjectId(&quot;5d9df46e0e0a6e032bf31182&quot;),
              &quot;replies&quot; : [
                  { 
                      &quot;reply&quot; : &quot;reply to comment &quot;,
                      &quot;_id&quot; : ObjectId(&quot;5d9bec26301798056bb07ab5&quot;)
                  },
                        ]
          }, 
      ],
  
  }
  </code></pre>
  <p>i have to fetch only a reply by id and now im using</p>
  <pre><code>Album.findOne(query,&quot;comments.replies.$&quot;).then(async (reply)=&gt;{
  const respo=await reply.comments[0].replies.find(data=&gt;data._id==req.params.replyid)
  </code></pre>
  <p>....</p>
  <p>is there a better way than this?? the above code fetches all the replies from comments subdocumnet</p>