add stub API for client bulk write #1574
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a stub to implement the client bulk write API proposed in mongodb/specifications#1534.
This is intended for early feedback, but not to merge.
Rationale
Options
The existing collection bulk write API accepts options in
bson_t *opts
:The proposed client bulk write API differs. Setter functions are added for improved type safety and editor auto complete:
Return
The existing collection bulk write API reports results and error information in a
bson_t *reply
:This PR notably differs. Getter functions are added for improved type safety and editor auto complete:
Map types are still reported in a
bson_t
:There is no existing convenient representation of map types. I expect needing to interact with verbose results is rare.
Errors are returned in
mongoc_bulkwriteexception_t
:The maps and lists are reported in the
bson_t **error_document
.The
mongoc_bulkwriteexception_t
can outlive themongoc_bulkwrite_t
. This is intended to enable wrapping languages to wrapmongoc_bulkwriteexception_t
when throwing an exception.