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
    fields.each { |f| document.attributes.delete(f) }
    execute("$unset")
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.