class Mongo::Operation::Write::UpdateUser

A MongoDB update user operation.

@example Initialize the operation.

Write::UpdateUser.new(:db_name => 'test', :user => user)

Initialization:

param [ Hash ] spec The specifications for the update.

option spec :user [ Auth::User ] The user to update.
option spec :db_name [ String ] The name of the database.

@since 2.0.0

Private Instance Methods

message() click to toggle source
# File lib/mongo/operation/write/update_user.rb, line 43
def message
  user_spec = { user: user.name }.merge(user.spec)
  Protocol::Update.new(db_name, Auth::User::COLLECTION, { user: user.name }, user_spec)
end
write_command_op() click to toggle source
# File lib/mongo/operation/write/update_user.rb, line 39
def write_command_op
  Command::UpdateUser.new(spec)
end