Articles → MONGODB → $Mul Operator In Mongodb$Mul Operator In MongodbIn this article, we will discuss the $mul operator in MongoDB.Purpose The $mul operator is an update operator used to multiply the value of a field by a specified amount.Example Consider the following collection: -The requirement is to multiply the value of age by 2. So, the query would be: -db.mycollection.updateMany({},{$mul:{age:2}})Output Posted By - Karan Gupta Posted On - Tuesday, March 19, 2024 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
db.mycollection.updateMany({},{$mul:{age:2}})
Query/Feedback