Database
[{"_id":1,"item":"sweatshirt","price.usd":45.99,"am":[{"id":1,"one":100}],qty:300},{"_id":2,"item":"winter coat","price.usd":499.99,"am":[{"id":2,"one":50}],qty:200},{"_id":3,"item":"sun dress","price.usd":199.99,"am":[{"id":1,"one":10}],qty:250}]
Query
db.collection.aggregate([{/** only pass docs that have a numerical "am.one"*/"$match":{"am.one":{"$type":"number"}}},{/** unwind in case multiple objects in "am"*/"$unwind":"$am"},{/** group by "id" and average "one" values*/"$group":{"_id":"$am.id","am1avg":{"$avg":"$am.one"}}}])