mongo find one and update where code example
Example 1: mongodb updateone
db.<collection>.updateOne({ id : 8400704 },{ $set: { name : "John" } })
Example 2: mongoid find_one_and_update
Model.where(id: id).find_one_and_update({
:$inc => {
payload
}
},
upsert: true,
return_document: :after
)