mongoc_collection_get_last_error - Man Page
- Warning:
Deprecated since version 1.9.0: To get write results from write operations, instead use:
- mongoc_collection_update_one() <>
- mongoc_collection_update_many() <>
- mongoc_collection_replace_one() <>
- mongoc_collection_delete_one() <>
- mongoc_collection_delete_many() <>
- mongoc_collection_insert_one() <>
- mongoc_collection_insert_many() <>
- mongoc_bulkwrite_t <>
- mongoc_bulk_operation_t <>
Synopsis
const bson_t * mongoc_collection_get_last_error (const mongoc_collection_t *collection);
Parameters
- collection: A mongoc_collection_t <>.
Description
mongoc_collection_get_last_error() <> returns write results from some operations:
- mongoc_collection_update() <>
- mongoc_collection_remove() <>
- mongoc_collection_delete() <>
- mongoc_collection_insert_bulk() <>
- mongoc_collection_insert() <>
Returns
A bson_t <https://www.mongoc.org/libbson/current/bson_t.html> that should not be modified or NULL. The returned bson_t <https://www.mongoc.org/libbson/current/bson_t.html> is may be invalidated by the next operation on collection.
Author
MongoDB, Inc
Copyright
2009-present, MongoDB, Inc.
Info
Jan 27, 2026 1.30.6 libmongoc