Class Mongoid::Atomic::Modifiers
In: lib/mongoid/atomic/modifiers.rb
Parent: Hash

This class contains the logic for supporting atomic operations against the database.

Methods

pull   push   set   unset  

Public Instance methods

Adds pull modifiers to the modifiers hash.

@example Add pull operations.

  modifiers.pull({ "addresses" => { "street" => "Bond" }})

@param [ Hash ] modifications The pull modifiers.

@since 2.2.0

Adds push modifiers to the modifiers hash.

@example Add push operations.

  modifiers.push({ "addresses" => { "street" => "Bond" }})

@param [ Hash ] modifications The push modifiers.

@since 2.1.0

Adds set operations to the modifiers hash.

@example Add set operations.

  modifiers.set({ "title" => "sir" })

@param [ Hash ] modifications The set modifiers.

@since 2.1.0

Adds unset operations to the modifiers hash.

@example Add unset operations.

  modifiers.unset([ "addresses" ])

@param [ Array<String> ] modifications The unset relation names.

@since 2.2.0

[Validate]