Sha256: 5609f1ede3b4a0fa4093cf99b3f169f492eb36b5604f372bbf1f1b46da484e06
Contents?: true
Size: 645 Bytes
Versions: 13
Compression:
Stored size: 645 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Commands class DeleteAll # Performs a delete of the all the +Documents+ that match the criteria # supplied. # # Options: # # params: A set of conditions to find the +Documents+ by. # klass: The class of the +Document+ to execute the find on. # # Example: # # <tt>DeleteAll.execute(Person, :conditions => { :field => "value" })</tt> def self.execute(klass, params = {}) collection = klass.collection collection.remove((params[:conditions] || {}).merge(:_type => klass.name)) end end end end
Version data entries
13 entries across 13 versions & 2 rubygems