Module: Mongoid::Persistable::Deletable::ClassMethods
- Defined in:
- build/mongoid-6.1/lib/mongoid/persistable/deletable.rb
Overview
Instance Method Summary collapse
-
#delete_all(conditions = {}) ⇒ Integer
Delete all documents given the supplied conditions.
Instance Method Details
#delete_all(conditions = {}) ⇒ Integer
Delete all documents given the supplied conditions. If no conditions are passed, the entire collection will be dropped for performance benefits. Does not fire any callbacks.
138 139 140 141 |
# File 'build/mongoid-6.1/lib/mongoid/persistable/deletable.rb', line 138 def delete_all(conditions = {}) selector = hereditary? ? conditions.merge(_type: name) : conditions where(selector).delete end |