#include <mongocxx/v_noabi/mongocxx/options/server_api.hpp>
Class representing options for server API.
- See also
-
|
enum class | version |
| Enum representing the possible values for server API version. More...
|
|
◆ version
Enum representing the possible values for server API version.
Enumerator |
---|
k_version_1 | Stable API Version 1.
|
◆ server_api()
mongocxx::v_noabi::options::server_api::server_api |
( |
version | version | ) |
|
Constructs a new server_api object.
The specified API version will be sent to the server. This will cause the server to behave in a manner compatible with that API version. The driver will behave in a manner compatible with a server configured with that API version, regardless of the server's actual release version.
- Parameters
-
version | The server api version to send to the server. |
◆ deprecation_errors() [1/2]
const stdx::optional< bool > & mongocxx::v_noabi::options::server_api::deprecation_errors |
( |
| ) |
const |
Gets the current value of the deprecation errors option.
- Returns
- The optional value of the deprecation errors option.
◆ deprecation_errors() [2/2]
server_api & mongocxx::v_noabi::options::server_api::deprecation_errors |
( |
bool | deprecation_errors | ) |
|
Sets the deprecation errors option, specifying whether the server should return errors for features that are deprecated in the declared API version.
- Parameters
-
deprecation_errors | The value to set deprecation errors to. |
- Returns
- A reference to this object to facilitate method chaining.
◆ get_version()
version mongocxx::v_noabi::options::server_api::get_version |
( |
| ) |
const |
Gets the declared server api version.
- Returns
- The version enum value specifying the declared server api version.
◆ strict() [1/2]
const stdx::optional< bool > & mongocxx::v_noabi::options::server_api::strict |
( |
| ) |
const |
Gets the current value of the strict option.
- Returns
- The optional value of the strict option.
◆ strict() [2/2]
server_api & mongocxx::v_noabi::options::server_api::strict |
( |
bool | strict | ) |
|
Sets the strict option, specifying whether the server should return errors for features that are not part of the declared API version.
- Parameters
-
strict | The value to set strict to. |
- Returns
- A reference to this object to facilitate method chaining.
◆ version_from_string()
Converts a version string to its enum value.
- Parameters
-
version | The string to convert to an enum value. |
- Exceptions
-
- Returns
- The enum value of the given string.
◆ version_to_string()
static std::string mongocxx::v_noabi::options::server_api::version_to_string |
( |
version | version | ) |
|
|
static |
Converts a version enum value to its string value.
- Parameters
-
version | The enum value to convert to a string. |
- Exceptions
-
- Returns
- The string value of the given enum value.
The documentation for this class was generated from the following file: