Skip to content

Conversation

@eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Dec 12, 2025

Resolves CXX-3237 and CXX-3238 for the v1::server_api component.

mongoc_server_api_t is not used as the underlying implementation due to the inability to convert v1::server_api::version (scoped enum: underlying type is int) to mongoc_server_api_version_t (unscoped enum: underlying type is "a suitably sized integer type"). Because "invalid API version" exceptions are only thrown upon request to convert to/from a string or by the make_server_api helper (only when required by client/pool ctors), validating this narrowing conversion with an exception would be a breaking change. Therefore, the v1::server_api fields continue to be handled independently by mongocxx rather than converted into mongoc values.

Because v1::server_api::version is completely equivalent to v_noabi::options::server_api::version, the latter is defined as an alias of the former (similar to v1::return_document). This avoids the need for v_noabi <-> v1 enumeration conversions.

@eramongodb eramongodb self-assigned this Dec 12, 2025
@eramongodb eramongodb requested a review from a team as a code owner December 12, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant