how to distinct array elements in mongodb in $project code example Example: find distinct in mongodb db.inventory.distinct( "item.sku", { dept: "A" } )