Mongodb – How to find the length of an array by filtering by a parameter value in Mongoose
I was building a chat server, where i need to get the number of messages that is not marked as seen . below is my schema const ChatSchema = mongoose.Schema({ chatId: { type: String, required: true, unique: true }, messages:…