Adds simple adjust! method to Mongoid - in the near future it should use the built-in Mongo DB functionality
MIT License
Adds adjust method to Mongoid::Document so you can adjust multiple items in a collection with the same mutation.
gem install mongoid_adjust
+Note:+
This functionality was taken from Mongo Mapper where it builds on the native multi-update functionality exposed by Mongo DB. Currently this project doesn't use the native Mongo DB functionality but that is a future goal!
The adjust! should allow for an operator symbol (:add, :subtract, :multiply, :divide), defaulting to :add
The above can currently be achieved using adjust!(:pos => -1), adding -1 to each.
Copyright (c) 2010 Kristian Mandrup. See LICENSE for details.