title: MongoDB Mongoose Add field to a populated objects
body: <p>I'm writing an API and I wanted to add a new field in my query that'll indicate if the <code>Comment</code> object was made by the user making a request.</p>
  <p>On my Comment Schema, I have a field that indicates the owner of the comment:</p>
  <pre><code>const CommentSchema: Schema = new mongoose.Schema&lt;CommentType&gt;({
    createdBy: {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'User',
      required: true
    },
  })
  </code></pre>
  <p>On my controller, I first aggregated adding another field I needed, and then I populate it to get the <code>Comment</code> objects:</p>
  <pre><code>const user = await User.findById(req.userId)
  const postQuery = await Post.aggregate()
      .addFields({ likedByUser: { $in: ['$_id', user.likedPosts] } })
      .match({ _id: new mongoose.Types.ObjectId(req.params.postId) })
      .project({ createdBy: 0, location: 0, createdAt: 0, __v: 0 })
  
  await Post.populate(postQuery, {
      path: 'comments',
      select: { _id: 1, text: 1 }
  })
  </code></pre>
  <p>At this point, I'm getting the correct data, but I wanted to add a field in each comment that will be true if the comment was made by the user and false otherwise, without having to loop over the results array I already have as this might get big, so not very efficient. I thought maybe even my populate could be done somehow only by the aggregate, that way it would be even more eficient I would say. Is that even possible?</p>