Loading...
Searching...
No Matches
mongocxx::v_noabi::events::server_description Class Reference

`#include <mongocxx/v_noabi/mongocxx/events/server_description.hpp>`

## Description

The description of a connected MongoDB server.

See also
  - mongocxx::v_noabi::events::topology_description

## Public Member Functions

| server_description (v1::events::server_description const &other)
| Construct with the mongocxx::v1 equivalent.
bsoncxx::v_noabi::document::view | hello () const
| The server's last response to the "hello" command, or an empty document if the driver has not yet reached the server or there was an error.
bsoncxx::v_noabi::stdx::string_view | host () const
| Returns the server host name.
std::uint32_t | id () const
| An opaque id, unique to this server for this mongocxx::v_noabi::client or mongocxx::v_noabi::pool.
bsoncxx::v_noabi::document::view | is_master () const
| operator v1::events::server_description () const
| Convert to the mongocxx::v1 equivalent.
std::uint16_t | port () const
| Returns the server port.
std::int64_t | round_trip_time () const
| The duration of the last hello call, indicating network latency.
bsoncxx::v_noabi::stdx::string_view | type () const
| The server type: "Unknown", "Standalone", "Mongos", "PossiblePrimary", "RSPrimary", "RSSecondary", "RSArbiter", "RSOther", or "RSGhost".

## Constructor & Destructor Documentation

## server_description()

mongocxx::v_noabi::events::server_description::server_description | ( | v1::events::server_description const & | other | ) |

Construct with the mongocxx::v1 equivalent.

Important
  *this MUST be used within the lifetime of other.

## Member Function Documentation

## hello()

bsoncxx::v_noabi::document::view mongocxx::v_noabi::events::server_description::hello | ( |  | ) | const

The server's last response to the "hello" command, or an empty document if the driver has not yet reached the server or there was an error.

Returns
  The response as a short-lived document view.

## host()

bsoncxx::v_noabi::stdx::string_view mongocxx::v_noabi::events::server_description::host | ( |  | ) | const

Returns the server host name.

Returns
  The host name.

## id()

std::uint32_t mongocxx::v_noabi::events::server_description::id | ( |  | ) | const

An opaque id, unique to this server for this mongocxx::v_noabi::client or mongocxx::v_noabi::pool.

Returns
  The id.

## is_master()

bsoncxx::v_noabi::document::view mongocxx::v_noabi::events::server_description::is_master | ( |  | ) | const

inline

Returns
  The response as a short-lived document view.

Deprecated
  use hello instead.

## operator v1::events::server_description()

mongocxx::v_noabi::events::server_description::operator v1::events::server_description | ( |  | ) | const

explicit

Convert to the mongocxx::v1 equivalent.

## port()

std::uint16_t mongocxx::v_noabi::events::server_description::port | ( |  | ) | const

Returns the server port.

Returns
  The port.

## round_trip_time()

std::int64_t mongocxx::v_noabi::events::server_description::round_trip_time | ( |  | ) | const

The duration of the last hello call, indicating network latency.

Returns
  The duration in microseconds.

## type()

bsoncxx::v_noabi::stdx::string_view mongocxx::v_noabi::events::server_description::type | ( |  | ) | const

The server type: "Unknown", "Standalone", "Mongos", "PossiblePrimary", "RSPrimary", "RSSecondary", "RSArbiter", "RSOther", or "RSGhost".

Returns
  The type as a short-lived string view.

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

- mongocxx/v_noabi/mongocxx/events/server_description.hpp