DOKK / manpages / debian 13 / libmongoc-doc / mongoc_collection_get_last_error.3.en
MONGOC_COLLECTION_GET_LAST_ERROR(3) libmongoc MONGOC_COLLECTION_GET_LAST_ERROR(3)

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



const bson_t *
mongoc_collection_get_last_error (const mongoc_collection_t *collection);


collection: A mongoc_collection_t.

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()

A bson_t that should not be modified or NULL. The returned bson_t is may be invalidated by the next operation on collection.

MongoDB, Inc

2009-present, MongoDB, Inc.

May 7, 2025 1.30.4