Sha256: 1277beb254502c54f1ca0a5552daa750b7330e58a10114a06dd37ab25ca3a409

Contents?: true

Size: 578 Bytes

Versions: 1

Compression:

Stored size: 578 Bytes

Contents

module Mongoid #:nodoc:
  module Commands
    class DeleteAll #:nodoc:
      # 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)
        klass.find(:all, params).each { |doc| Delete.execute(doc) }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid-0.4.1 lib/mongoid/commands/delete_all.rb