Database

[{"image":"img1"},{"image":"img2"}]

Query

db.collection.update({},[{"$addFields":{"image":{"$function":{"body":"function(image){return \"https://www.example.com/products/\"+hex_md5(image)+\".png\"}","args":["$image"],"lang":"js"}}}}],{multi:true})

Result