Method: Mongoid::Atomic::Modifiers#pull

Defined in:
lib/mongoid/atomic/modifiers.rb

#pull(modifications) ⇒ Object

Adds pull all modifiers to the modifiers hash.

Examples:

Add pull all operations.

modifiers.pull({ "addresses" => { "_id" => { "$in" => [ 1, 2, 3 ]}}})

Parameters:

  • modifications (Hash)

    The pull all modifiers.

Since:

  • 3.0.0



52
53
54
55
56
57
# File 'lib/mongoid/atomic/modifiers.rb', line 52

def pull(modifications)
  modifications.each_pair do |field, value|
    pulls[field] = value
    pull_fields[field.split(".", 2)[0]] = field
  end
end