I have some Product
documents that each contain a list of ProductVariation
sub-documents. I need to find all the Product
docs where ALL their child ProductVariation
docs have zero quantity.
Schemas look like this:
var Product = new mongoose.Schema({
name: String,
variations: [ProductVariation]
});
var ProductVariation = new mongoose.Schema({
type: String,
quantity: Number,
price: Number
});
I am a little new to mongodb, so even sure where to start here.