Class: Mongoid::Persistence::Atomic::Unset
- Inherits:
-
Object
- Object
- Mongoid::Persistence::Atomic::Unset
- Includes:
- Operation
- Defined in:
- lib/mongoid/persistence/atomic/unset.rb
Overview
Performs atomic $unset operations.
Instance Attribute Summary
Attributes included from Operation
#document, #field, #options, #value
Instance Method Summary (collapse)
-
- (nil) persist
Sends the atomic $unset operation to the database.
Methods included from Operation
#collection, #initialize, #operation, #path, #prepare
Instance Method Details
- (nil) persist
Sends the atomic $unset operation to the database.
18 19 20 21 22 23 |
# File 'lib/mongoid/persistence/atomic/unset.rb', line 18 def persist prepare do document.attributes.delete(field) execute("$unset") end end |