find_one_and_update mongoid 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
)