I have two collection present in mongodb database. one status column is common. I need matched and unmatched count from both the collection based on status column. I have written some code but it fetching only matched count.
db.properties.aggregate([
{
$lookup: {
from: "old_properties_data",
localField: "identifier",
foreignField: "identifier",
as: "col2docs"
}
},
{"$group" : {_id:"_id", count:{$sum:1}}}
])