Question : how to increase one per update mongodb
Answered by : abid-hasan
db.post.updateOne( { _id: "62da5df7d07d2753d79f7775" }, { $inc: { views: 1 } }
)
Source : https://www.mongodb.com/docs/manual/reference/operator/update/inc/ | Last Update : Tue, 04 Oct 22