Method: Mongoid::Atomic::Modifiers#push
- Defined in:
- lib/mongoid/atomic/modifiers.rb
#push(modifications) ⇒ Object
Adds push modifiers to the modifiers hash.
61 62 63 64 65 66 67 |
# File 'lib/mongoid/atomic/modifiers.rb', line 61 def push(modifications) modifications.each_pair do |field, value| push_fields[field] = field mods = push_conflict?(field) ? conflicting_pushes : pushes add_operation(mods, field, { '$each' => Array.wrap(value) }) end end |