sv1haw
Last Updated: February 19, 2017
·
2.043K
· neutralino1

Atomic increment in Mongoid

If you have to increment a value via Mongoid, simply go for the Model#inc method:

person.inc(:age, 1)

See other atomic operations on the official doc.

1 Response
Add your response

28623

That is very helpful, is there a method to decrement too? - I can't seem to find out.

over 1 year ago ·