|
I have re-validated the C++ driver for DRIVERS-291, and have filed CXX-1339 for follow-up work required for the driver to be fully validated against this DRIVERS ticket. See below for full notes of audit (bolded text indicates problematic or potentially problematic areas, which are re-summarized in CXX-1339).
DRIVERS-291 includes changes to three specs:
- CRUD:
- The "collation" option is added to several options/model classes. These (A) must be sent to the server if the user specifies them, and (B) the associated database operations must fail if the server version is <3.4.
- options::aggregate: A and B tested by "aggregation with collation" test.
- options::count: A and B tested by "count with collation" test.
- options::distinct: A and B tested by "distinct with collation" test.
- options::find: A and B tested by "find with collation" and "find_one with collation" tests.
- options::update: A and B tested by "update_one with collation" and "update_many with collation" tests.
- options::delete_options: A and B tested by "delete_one with collation" and "delete_many with collation" tests.
- options::find_one_and_delete: A and B tested by "find_one_and_delete works / with collation" test.
- options::find_one_and_replace: A and B tested by "find_one_and_replace works / with collation" test.
- options::find_one_and_update: A and B tested by "find_one_and_update works / with collation" test.
- model::delete_one: A tested by "delete_one with collation invokes mongoc_bulk_operation_remove_one_with_opts with collation" test. B verified manually by libmongoc code inspection: https://github.com/mongodb/mongo-c-driver/blob/1.5.0/src/mongoc/mongoc-write-command.c#L1274-L1281. API guarantee for mongoc_bulk_operation_execute() is undocumented, as far as I can tell.
- model::delete_many: A tested by "delete_many with collation invokes mongoc_bulk_operation_remove_many_with_opts with collation" test. B verified manually via same method as model::delete_one.
- model::replace_one: A tested by "replace_one with collation invokes mongoc_bulk_operation_replace_one_with_opts with collation" test. B verified manually via same method as model::delete_one.
- model::update_one: A tested by "update_one with collation invokes mongoc_bulk_operation_update_one_with_opts with collation" test. B verified manually via same method as model::delete_one.
- model::update_many: A tested by "update_many with collation invokes mongoc_bulk_operation_update_many_with_opts with collation" test. B verified manually via same method as model::delete_one.
- Database operations for update / delete (via both CRUD methods and write models) must fail when using unacknowledged writes if a collation is specified.
- Index management
- The "collation" option is added to index options.
- options::index: tested by "create_index tests / with collation".
- Collation
- "Collation Document Model" section
- The driver doesn't have a collation document model, collation is specified by bsoncxx::document::value.
- The driver doesn't inspect the contents of the "collation" document.
- mongocxx::database::run_command() doesn't inspect the "collation" subdocument. Possibly a candidate for testing, since we don't have a guarantee that the C driver method we use doesn't do this.
- "API" section.
- The "create collection" helper must take a default collation.
- options::create_collection: tested by "A database may create a collection via create_collection / with collation" test.
- options::create_view: tested by "A database may create a view via create_view / with collation" test.
- All helpers for aggregate, count, distinct, find (command only), findAndModify, geoNear, group, mapReduce, delete (command only), update (command only) must be updated.
- All helpers present in the driver have been updated.
- "Require maxWireVersion 5" section
- See above: all tests noted in this comment have "Require maxWireVersion 5" sections
- "Opcode-based Unacknowledged Writes" section
- See "Database operations for update / delete..." above.
- "Setting a default collation on a collection" section
- See 'The "create collection" helper' above.
- "BulkWrite API" section
- "Test Plan" section
- "drivers should test that two indexes can be created with identical key patterns and different collations" test ... then, the test should ensure that the correct index is dropped when delete_one is called with an index name" => C++ driver is lacking such a test.
- "Errors are raised in each place Collation can be provided to a API method and the selected server has maxWireVersion < 5." => yes, we do this.
|