In the Rust Driver, read_concern fields (example) are represented using the ReadConcern type, which has a single field level of type ReadConcernLevel.
ReadConcernLevel contains the expected values (Local, Majority, etc.) as unit variants, but also contains a Custom(String) variant with the following documentation:
> Specify a custom read concern level. This is present to provide forwards compatibility with any future read concerns which may be added to new versions of MongoDB.
There are a number of ways we could go about representing read_concern fields in the C API:
- Implement ReadConcernT or provide functions to set the read concern level directly on read_concern fields.
- Regarding ReadConcernLevel:
- Use mongoac_string_view_t (i.e. Custom under the hood) exclusively. A simple and flexible API, but lacks the compile-time guarantees that the read concern levels are valid.
- Use enumerators for each unit variant (e.g. MONGOAC_READ_CONCERN_LEVEL_LOCAL) with no support for custom read concern level. A simple API with stronger guarantees, but lacks the forwards-compatibility advantages of Custom.
- Use enumerators for each unit variant and support custom read concern level. All the advantages of the alternatives above, but complicates the API.
- is depended on by
-
CDRIVER-6586 Implement FindOneOptionsT and FindOptionsT
-
- Blocked
-
-
CDRIVER-6589 Implement CountOptionsT, EstimatedDocumentCountOptionsT, and DistinctOptionsT
-
- Blocked
-
-
CDRIVER-6590 Implement DatabaseOptionsT
-
- Blocked
-
-
CDRIVER-6592 Implement SessionOptionsT and TransactionOptionsT
-
- Blocked
-
-
CDRIVER-6593 Implement AggregateOptionsT
-
- Blocked
-