Module: Mongo::Operation::Write::WriteCommandEnabled
- Included in:
- CreateIndex, CreateUser, Delete, DropIndex, Insert, RemoveUser, Update, UpdateUser
- Defined in:
- lib/mongo/operation/write/write_command_enabled.rb
Overview
This module contains common functionality for operations that send either a write command or a specific wire protocol message, depending on server version. For server versions >= 2.6, a write command is sent.
Instance Method Summary collapse
-
#execute(server) ⇒ Result
Execute the operation.
Instance Method Details
#execute(server) ⇒ Result
Execute the operation.
36 37 38 39 40 41 42 43 |
# File 'lib/mongo/operation/write/write_command_enabled.rb', line 36 def execute(server) if !server.features.write_command_enabled? || unacknowledged_write? raise Error::UnsupportedCollation.new(Error::UnsupportedCollation::UNACKNOWLEDGED_WRITES_MESSAGE) if has_collation? (server) else execute_write_command(server) end end |