I have a variable which is an array of comments.
$scope.numOfCommentsCoupon
What i would like to have is a variable which is a count of the Comments inside the array that have a "couponId" of a certain value.
Here is the Comment Model
var CommentSchema = new Schema({
created: {
type: Date,
default: Date.now
},
couponId: {
type: String,
trim: true
}
});
So i need to filter it and then count it but im not sure how to.