I have a collection with:
name weight amount—————————————-apple 2 3banana 2 5pear 2 5
I want add a column about the total price, which is equal to weight * amount
name weight amount total—————————————————-apple 2 3 6banana 2 5 10pear 2 5 10
Method 1: collection.find() + update_one()
Method 2: collection.aggregate() with $project, $multiply and $out