So I worked up a little MongoMapper pluggin that did the trick:
Then to use it, simply, add the plugin to your document model:
class FindAndModifyTest
include MongoMapper::Document
plugin FindAndModifyPlugin
end
Here's an rspec test that shows how it works:
Voilà
Kevin
1 comment:
thank you for plugin.
Post a Comment