Database
[{id:1,b:{"field1":["foo","foo1"],"field2":["bar"]}},{id:2,b:{"field2":["foobar"],"field3":["foofoo"]}}]
Query
db.collection.aggregate([{$project:{b_grouped:{$reduce:{input:{$objectToArray:"$b"},initialValue:[],in:{$concatArrays:["$$this.v","$$value"]}}}}}])