Method: Mongoid::Contextual::Atomic#pull

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

#pull(pulls) ⇒ nil

Note:

Expression pulling is not yet supported.

Perform an atomic $pull operation on the matching documents.

Examples:

Pull the value from the matches.

context.pull(members: "Dave")

Parameters:

  • pulls (Hash)

    The operations.

Returns:

  • (nil)

    Nil.



99
100
101
# File 'lib/mongoid/contextual/atomic.rb', line 99

def pull(pulls)
  view.update_many("$pull" => collect_operations(pulls))
end