sv1haw
Last Updated: February 19, 2017
·
1.792K
· neutralino1
981494 10151466984546915 1613396205 o

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.

Say Thanks
Respond

1 Response
Add your response

28623

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

9 months ago ·