MongoDB C++ Driver
mongocxx-3.0.2
|
Class representing a MongoDB connection string URI. More...
#include <uri.hpp>
Classes | |
struct | host |
Public Member Functions | |
uri (bsoncxx::string::view_or_value uri_string=k_default_uri) | |
Constructs a uri from an optional MongoDB uri string. More... | |
uri (uri &&) noexcept | |
Move constructs a uri. | |
uri & | operator= (uri &&) noexcept |
Move assigns a uri. | |
~uri () | |
Destroys a uri. | |
std::string | auth_mechanism () const |
Returns the authentication mechanism from the uri. More... | |
std::string | auth_source () const |
Returns the authentication source from the uri. More... | |
std::vector< host > | hosts () const |
Returns the hosts from the uri. More... | |
std::string | database () const |
Returns the database from the uri. More... | |
bsoncxx::document::view | options () const |
Returns other uri options. More... | |
std::string | password () const |
Returns the password from the uri. More... | |
class read_concern | read_concern () const |
Returns the read concern from the uri. More... | |
class read_preference | read_preference () const |
Returns the read preference from the uri. More... | |
std::string | replica_set () const |
Returns the replica set specified in the uri. More... | |
bool | ssl () const |
Returns the ssl parameter from the uri. More... | |
std::string | to_string () const |
Returns the uri in a string format. More... | |
std::string | username () const |
Returns the supplied username from the uri. More... | |
class write_concern | write_concern () const |
Returns the write concern specified in the uri. More... | |
Class representing a MongoDB connection string URI.
return const char* instead or stringview
harmonize with C library (options, credentials, etc...)
mongocxx::uri::uri | ( | bsoncxx::string::view_or_value | uri_string = k_default_uri | ) |
Constructs a uri from an optional MongoDB uri string.
If no uri string is specified, uses the default uri string, 'mongodb://localhost:27017'.
uri_string | String representing a MongoDB connection string uri, defaults to k_default_uri. |
std::string mongocxx::uri::auth_mechanism | ( | ) | const |
Returns the authentication mechanism from the uri.
std::string mongocxx::uri::auth_source | ( | ) | const |
Returns the authentication source from the uri.
std::string mongocxx::uri::database | ( | ) | const |
Returns the database from the uri.
std::vector<host> mongocxx::uri::hosts | ( | ) | const |
Returns the hosts from the uri.
bsoncxx::document::view mongocxx::uri::options | ( | ) | const |
Returns other uri options.
std::string mongocxx::uri::password | ( | ) | const |
Returns the password from the uri.
class read_concern mongocxx::uri::read_concern | ( | ) | const |
Returns the read concern from the uri.
class read_preference mongocxx::uri::read_preference | ( | ) | const |
Returns the read preference from the uri.
std::string mongocxx::uri::replica_set | ( | ) | const |
Returns the replica set specified in the uri.
bool mongocxx::uri::ssl | ( | ) | const |
Returns the ssl parameter from the uri.
true
if ssl is enabled and false
if not. std::string mongocxx::uri::to_string | ( | ) | const |
Returns the uri in a string format.
std::string mongocxx::uri::username | ( | ) | const |
Returns the supplied username from the uri.
class write_concern mongocxx::uri::write_concern | ( | ) | const |
Returns the write concern specified in the uri.