Zaktualizuj pierwszy $match
do
{
"$match": {
"_id": ObjectId("595e3b2033961713940442cf"),
"History.datetime": {
"$lte": 1507529239000,
"$gte": 1507012285558
},
"History.Action": {
"$in": [
"Comment",
"like"
]
}
}
}
i drugi $match
do
{
"$match": {
"History.datetime": {
"$lte": 1507529239000,
"$gte": 1507012285558
},
"History.Action": {
"$in": [
"Comment",
"like"
]
}
}
}
i $group
do
{
"likecount": {
"$sum": {
"$cond": [
{
"$eq": [
"$History.Action",
"like"
]
},
1,
0
]
}
}
}