class Mongo::Operation::Write::Command::UpdateUser

Update user command on non-legacy servers.

@since 2.0.0

Public Instance Methods

execute(server) click to toggle source

Execute the operation.

@example Execute the operation.

operation.execute(server)

@param [ Mongo::Server ] server The server to send this operation to.

@return [ Result ] The operation response, if there is one.

@since 2.5.0

# File lib/mongo/operation/write/command/update_user.rb, line 38
def execute(server)
  result = Result.new(server.with_connection do |connection|
    connection.dispatch([ message(server) ], operation_id)
  end)
  server.update_cluster_time(result)
  session.process(result) if session
  result.validate!
end

Private Instance Methods

selector() click to toggle source

The query selector for this update user command operation.

@return [ Hash ] The selector describing this update user operation.

@since 2.0.0

# File lib/mongo/operation/write/command/update_user.rb, line 54
def selector
  { :updateUser => user.name, :digestPassword => false }.merge(user.spec)
end