Re: find_and_modify absent?

24 views
Skip to first unread message

Kevin Bullaughey

unread,
Aug 28, 2012, 2:13:45 PM8/28/12
to mongo...@googlegroups.com
I am currently working around the issue with a tiny plugin:

# Plugin for MongoMapper that adds find_and_modify support
module FindAndModifyPlugin
  extend ActiveSupport::Concern
  
  module ClassMethods
    def find_and_modify(options)
      load collection.find_and_modify(options)
    end
  end
end

I have more info in this blog post:

http://jottingsoncomputation.blogspot.com/2012/08/adding-findandmodify-to-mongomapper-and.html

Kevin

On Tuesday, August 28, 2012 6:25:16 AM UTC-4, Kevin Bullaughey wrote:
Did I miss find_and_modify? or is it not part of MongoMapper? 

If it's not part of MongoMapper, is there some reason? 

I feel it's one of the most useful aspects of MongoDB. Of course, I can use it directly on the collection object via the ruby driver, but it seems like there would be some advantages to working it into MongoMapper (and maybe plucky?). If it's just awaiting someone to work on it, I could give it a stab. 

Thanks,
Kevin
Reply all
Reply to author
Forward
0 new messages