Class | Mongoid::Persistence::Operations::Embedded::Remove |
In: |
lib/mongoid/persistence/operations/embedded/remove.rb
|
Parent: | Object |
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 );
Remove the document from the database. If the parent is a new record, it will get removed in Ruby only. If the parent is not a new record then either an $unset or $set will occur, depending if it‘s an embeds_one or embeds_many.
@example Remove an embedded document.
RemoveEmbedded.persist
@return [ true ] Always true.