Parent

Methods

Class/Module Index [+]

Quicksearch

Mongoid::Persistence::Atomic::Unset

Performs atomic $unset operations.

Public Instance Methods

persist() click to toggle source

Sends the atomic $unset operation to the database.

@example Persist the new values.

unset.persist

@return [ nil ] The new value.

@since 2.1.0

# File lib/mongoid/persistence/atomic/unset.rb, line 17
def persist
  prepare do
    document.attributes.delete(field)
    collection.update(document.atomic_selector, operation("$unset"), options)
    document.remove_change(value)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.