Mongo Playground

Configuration

[{"name":"david","num1":5,"num2":4,"ml_proc":{"sm":7,"prod":12}},{"name":"john","num1":1,"num2":4},{"name":"dune","num1":5,"num2":5,"ml_proc":{"sm":7,"prod":15}},{"name":"jan","num1":3,"num2":4}]

Query

db.collection.update({"ml_proc":{$exists:false}},[{$addFields:{ml_proc:{sm:{$sum:["$num1",2]},prod:{$sum:["$num2",2]}}}}],{multi:true})

Result