def update_many(spec, opts = {})
update_doc = { Operation::Q => filter,
Operation::U => spec,
Operation::MULTI => true,
Operation::UPSERT => !!opts[:upsert] }
with_session(opts) do |session|
legacy_write_with_retry do |server|
apply_collation!(update_doc, server, opts)
apply_array_filters!(update_doc, server, opts)
Operation::Update.new(
:updates => [ update_doc ],
:db_name => collection.database.name,
:coll_name => collection.name,
:write_concern => collection.write_concern,
:bypass_document_validation => !!opts[:bypass_document_validation],
:session => session
).execute(server)
end
end
end