Method: Mongoid::Atomic#add_atomic_pull

Defined in:
lib/mongoid/atomic.rb

#add_atomic_pull(document) ⇒ Object

Add the document as an atomic pull.

Examples:

Add the atomic pull.

person.add_atomic_pull(address)

Parameters:

  • The (Document)

    embedded document to pull.

Since:

  • 2.2.0



37
38
39
40
# File 'lib/mongoid/atomic.rb', line 37

def add_atomic_pull(document)
  document.flagged_for_destroy = true
  (delayed_atomic_pulls[document..to_s] ||= []).push(document)
end