mongo find one and update where clause code example
Example: mongoid find_one_and_update
Model.where(id: id).find_one_and_update({
:$inc => {
payload
}
},
upsert: true,
return_document: :after
)
Model.where(id: id).find_one_and_update({
:$inc => {
payload
}
},
upsert: true,
return_document: :after
)