title: mongoose subdocument virtual in array
body: <p>Lets say i have a comment schema. A comment can have several replies. How can i create a virtual attribute to transform each reply's <code>created_at</code> date like this? <code>moment(this.replies.[currentReplyIndex].created_at).format('lll')</code></p>
  
  <pre><code>const Comment = new mongoose.Schema({ // sort: new to old by created_at
    body: String,
    replies: [{
      body: String,
      created_at: {
        type: Date,
        default: Date.now
      }
    }]
  });
  </code></pre>
  
  <p>I have no idea how to do this with an array of objects subdocument structure.</p>