Class: Mongoid::Persistence::RemoveAll
- Defined in:
- lib/mongoid/persistence/remove_all.rb
Overview
Remove is a persistence command responsible for deleting a document from the database.
The underlying query resembles the following MongoDB query:
collection.remove(
{ "field" : value },
false
);
Instance Attribute Summary
Attributes inherited from Command
#collection, #document, #klass, #options, #selector, #suppress, #validate
Instance Method Summary collapse
-
#persist ⇒ Object
Remove the document from the database: delegates to the MongoDB collection remove method.
Methods inherited from Command
Methods included from Safe
Constructor Details
This class inherits a constructor from Mongoid::Persistence::Command
Instance Method Details
#persist ⇒ Object
Remove the document from the database: delegates to the MongoDB collection remove method.
Example:
Remove.persist
Returns:
true
if success, false
if not.
26 27 28 |
# File 'lib/mongoid/persistence/remove_all.rb', line 26 def persist remove end |