I have the following code:
const queryOptions = {
populate: { path: 'createdBy', select: 'username updatedAt createdAt timestamps' },
limit: options.limit,
skip: (options.page - 1) * options.limit,
sort: undefined as any
};
const query = {};
await Comment.find(query, null, queryOptions)
The issue is that I need the timestamp of when the user was last modified as part of this query, but there are no createdAt or updatedAt fields being returned.
Can anyone suggest how to get the updatedAt field value as part of populating field?