i have my documents like this after aggregation lookup
1. lookup
{
from: 'dogs',
localField: 'ton_id',
foreignField: 'ton_id',
as: 'catch'
}
the result after lookup :
_id:ObjectId("5deasn732bksd595bq65")
admin : Array
0 : object
_id:ObjectId("5dasdfkjh18364csd251as21")
ton_id:"255"
contact:"17942365"
catch: Array
0 : object
_id:ObjectId("5deasd64bcsd251as21")
ton_id:"255"
breed:"dog"
age :"5"
1 : object
_id:ObjectId("5deasdsdfbwj83921as21")
ton_id:"255"
breed:"cat"
age :"7"
2 : object
_id:ObjectId("5ddsgergdsdfbwj83921as21")
ton_id:"255"
breed:"cat"
age :"8"
Need to use $match and get only breed of cats like this and which has age 8
catch: Array
0 : object
_id:ObjectId("5ddsgergdsdfbwj83921as21")
breed:"cat"
age :"8"
tried this after using $lookup
$match
{catch: { $elemMatch: {'breed':"cat",'age':"8" } }}
it is returning no output