Database

[{"item":[{"adjudication":[{"amount":{"code":"USD","system":"4217","value":22.51},"category":{"coding":[{"code":"bb.org/paid_amt","system":"bb.org/adjudication"}]}},{"amount":{"code":"USD","system":"4217","value":0},"category":{"coding":[{"code":"bb.org/discount_amt","system":"bb.org/adjudication"}]}}]}]}]

Query

db.collection.aggregate([{"$unwind":"$item"},{$project:{"item.adjudication":{"$map":{"input":"$item.adjudication","in":{amount:"$$this.amount.value",code:{"$arrayElemAt":["$$this.category.coding",0]}}}}}},{$project:{"item.adjudication":{"$map":{"input":"$item.adjudication","in":{v:"$$this.amount",k:{"$let":{"vars":{"code":{"$split":["$$this.code.code","/"]}},"in":{"$arrayElemAt":["$$code",-1]}}}}}}}},{$project:{"item.adjudication":{"$arrayToObject":"$item.adjudication"}}},{"$group":{"_id":"$_id","item":{"$push":"$item"}}}])

Result