MongoDB C++ Driver  mongocxx-3.7.0
Public Member Functions | List of all members
mongocxx::events::command_failed_event Class Reference

An event notification sent when the driver fails to execute a MongoDB command. More...

#include <command_failed_event.hpp>

Public Member Functions

 ~command_failed_event ()
 Destroys a command_failed_event.
 
bsoncxx::document::view failure () const
 Returns the server’s reply to the failed operation. More...
 
bsoncxx::stdx::string_view command_name () const
 Returns the name of the command. More...
 
std::int64_t duration () const
 Returns the duration of the failed operation. More...
 
std::int64_t request_id () const
 Returns the request id. More...
 
std::int64_t operation_id () const
 Returns the operation id. More...
 
bsoncxx::stdx::optional< bsoncxx::oidservice_id () const
 Optionally returns the service id. More...
 
bsoncxx::stdx::string_view host () const
 Returns the host name. More...
 
std::uint16_t port () const
 Returns the port. More...
 

Detailed Description

An event notification sent when the driver fails to execute a MongoDB command.

See also
"CommandFailedEvent" in https://github.com/mongodb/specifications/blob/master/source/command-monitoring/command-monitoring.rst

Member Function Documentation

◆ command_name()

bsoncxx::stdx::string_view mongocxx::events::command_failed_event::command_name ( ) const

Returns the name of the command.

Returns
The command name.

◆ duration()

std::int64_t mongocxx::events::command_failed_event::duration ( ) const

Returns the duration of the failed operation.

Returns
The duration in microseconds.

◆ failure()

bsoncxx::document::view mongocxx::events::command_failed_event::failure ( ) const

Returns the server’s reply to the failed operation.

Returns
The failure.

◆ host()

bsoncxx::stdx::string_view mongocxx::events::command_failed_event::host ( ) const

Returns the host name.

Returns
The host name.

◆ operation_id()

std::int64_t mongocxx::events::command_failed_event::operation_id ( ) const

Returns the operation id.

Returns
The operation id.

◆ port()

std::uint16_t mongocxx::events::command_failed_event::port ( ) const

Returns the port.

Returns
The port.

◆ request_id()

std::int64_t mongocxx::events::command_failed_event::request_id ( ) const

Returns the request id.

Returns
The request id.

◆ service_id()

bsoncxx::stdx::optional<bsoncxx::oid> mongocxx::events::command_failed_event::service_id ( ) const

Optionally returns the service id.

Returns
No contained value, or contains the service id if load balancing is enabled.

The documentation for this class was generated from the following file: