Counts how many items exists in db.orders.products array. Inside aggregate query you only need to chance $products to be the property which contains an array db.orders.aggregate([{$project: {item: 1, bookings: {$size:"$products"}}}])