Count array elements that matches condition
问题 I have a mongoDB collection called "conference" with an array of participants as below : [ { "_id" : 5b894357a0c84d5a5d221f25, "conferenceName" : "myFirstConference", "startDate" : 1535722327, "endDate" : 1535722420, "participants" : [ { "name" : "user1", "origin" : "internal", "ip" : "192.168.0.2" }, { "name" : "user2", "origin" : "external", "ip" : "172.20.0.3" }, ] }, ... ] I would like to get the following result : [ { "conferenceName" : "myFirstConference", "startDate" : 1535722327,