Mongo Playground

Configuration

[{name:"John",foo:{fooA:8753.19,fooB:8753.19,},bar:{barA:196.99,barB:196.99,},}]

Query

db.collection.aggregate({"$addFields":{"foo.total":{$add:["$foo.fooA","$foo.fooB"]},"bar.total":{$add:["$bar.barA","$bar.barB"]}}})

Result