Parent

Methods

Class/Module Index [+]

Quicksearch

Mongoid::Persistence::Operations::Remove

Remove is a persistence command responsible for deleting a document from the database.

The underlying query resembles the following MongoDB query:

collection.remove(
  { "_id" : 1 },
  false
);

Public Instance Methods

persist() click to toggle source

Remove the document from the database: delegates to the MongoDB collection remove method.

@example Remove the document.

Remove.persist

@return [ true ] Always true.

# File lib/mongoid/persistence/operations/remove.rb, line 24
def persist
  prepare do |doc|
    collection.remove({ :_id => doc.id }, options)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.