Method: Mongoid::Relations::Embedded::Batchable#batch_remove
- Defined in:
- lib/mongoid/relations/embedded/batchable.rb
#batch_remove(docs, method = :delete) ⇒ Object
Batch remove the provided documents as a $pullAll.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/mongoid/relations/embedded/batchable.rb', line 57 def batch_remove(docs, method = :delete) removals = pre_process_batch_remove(docs, method) if !docs.empty? collection.find(selector).update( positionally(selector, "$pullAll" => { path => removals }) ) post_process_batch_remove(docs, method) end reindex end |