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

Description

mongoc_collection_get_last_error() <> returns write results from some operations:

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

Info

Jan 27, 2026 1.30.6 libmongoc