-
Notifications
You must be signed in to change notification settings - Fork 455
CDRIVER-3054 fix docs and test mongoc_collection_get_last_error
#1782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Note applicable operations. Remove note about unacknowledged writes. An unacknowledged write concern may still produce a non-empty document (e.g. on a network error).
.. warning:: | ||
.. deprecated:: 1.9.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a replacement/recommendation to be documented with the deprecation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not currently. I do not plan to add an alternative. mongoc_collection_get_last_error
has had the deprecation attribute since 1.9.0. GitHub code search shows no use of mongoc_collection_get_last_error, despite showing use of mongoc_collection_remove, mongoc_collection_insert, and mongoc_collection_update. So I expect this is non-disruptive. If there are reports requesting re-adding, a better named alternative could be considered (mongoc_collection_get_last_write_result
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily a dedicated API to replace it, but is there a way to get the same information that this function provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Updated deprecation to note other write functions that return write results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix documentation and add tests for
mongoc_collection_get_last_error
.This PR is related to, but does not resolve CDRIVER-3054.
Verified by this patch build.
Background
mongoc_collection_get_last_error
may be used to obtain results frommongoc_collection_(remove|insert|update)
.mongoc_collection_get_last_error
has been marked deprecated withBSON_GNUC_DEPRECATED
since 1.9.0 (CDRIVER-2243) but public docs were not updated.