increment column value by 1 in mongodb

questionsCategory: Questionsincrement column value by 1 in mongodb
Pradeep asked 4 months ago

hi i am working with mongo DB, like My SQL to increment a column value how can i perform in mongo DB.
For Example :
i have a collection empdetails having column salary, i want to write querry to increment 10% salry of all employee in single querry

1 Answers
Abhishek Todkar answered 4 months ago

Here is the query you can try:
db.empdetails.update({}, { $mul: { salary: 1.1 } });