I have 3 collections that are referred to each other such that
A -> B -> C
I want to filter data after matching that with B and from B to C
Collection 1
Products: [{
_id:ObjectId(),
name:"product1",
productCatalogue:[reference to productCatalogue collection]
},....]
Collection 2
productCatalogue: [{
_id:ObjectId(),
name:"catelgoue1",
category:{
cat:[reference to category table],
sub1:[reference to category table],
sub2:[reference to category table]
}
},...]
Collection 3
category: [{
_id:ObjectId(),
name:"cat1",
type:"parent"
},....]
I want to filter data such that products having catalog:catelgoue1 and category: cat1 will be filtered using aggregation.