Mongodb – How to slice certain amount of elements from sub-array in Mongoose?
There're hundreds of items and each item contains comments. Each comment contains author, content, likes, replies. Since each item is likely to have hundreds of comments, I embedded comment's id into sub-array inside item document. const itemSchema = new mongoose.Schema(…