Database

db={"post":[{"_id":"123","time":"sometime","text":"some text","totalCommentsCount":10,"likes":5,"category":3,"videoUrl":"youtube.com"},{"_id":"546","time":"sometime","text":"some text","totalCommentsCount":10,"likes":5,"category":3,"videoUrl":"youtube.com"}],"comment":[{"text":"a comment","time":"sometime","likes":10,"postId":"123"}]}

Query

db.post.aggregate([{$lookup:{from:"comment",let:{"pId":"$_id"},pipeline:[{$match:{$expr:{$eq:["$postId","$$pId"]}}}],as:"comments"}},{$sort:{_id:1}},{$group:{_id:null,data:{$push:"$$ROOT"},totalRecords:{$sum:1}}},{$unwind:"$data"},{$skip:1},{$limit:1}])

Result