I need to retrieve only records that have at least one element in the format.prices array and every elements price are between 0 and 0.99:
So this works fine for the price comparison:
{ 'formats.prices': { $not: { $elemMatch: { price: { $gt: 0, $lte: 0.99 } } } } }
But how can I add the condition like $not: { $size: 0 } to exclude also the formats.prices without elements at all?