How to update all in mongoid

March 4, 2012 § Leave a comment

in Active record we simply use Model.update_all() then how we do that in mongoid ?
simple.. use collection.update, example:

Article.collection.update({:user_id => self.id}, {"$set" => {:status => self.status}}, {:multi => true})

Where Am I?

You are currently browsing the MongoDB category at Kubid on rails blog.