MONGOC_COLLECT...GET_LAST_ERROR(3)
π MONGOC_COLLECT...GET_LAST_ERROR π
ok so bestie, this is a page from the libmongoc manual β it's MONGOC_COLLECT...GET_LAST_ERROR(3), and yes the name is literally that long, it's giving "my full legal name on my birth certificate" energy π. Sit down, grab a boba, we're getting into it.
β οΈ WARNING β οΈ
Deprecated since version 1.9.0. bestie it's over, this function is in its flop era π
Like, to actually get write results from write operations, use these instead:
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_tmongoc_bulk_operation_t
periodt. those are the main characters now π
β¨ SYNOPSIS β¨
const bson_t *
mongoc_collection_get_last_error (const mongoc_collection_t *collection);
look at that signature, so clean, so simple π
πΈ PARAMETERS πΈ
collectionβ amongoc_collection_t. that's it. that's the whole parameter list. no cap π«Ά
π¦ DESCRIPTION π¦
so mongoc_collection_get_last_error() hands you back the write results from some operations β not all of them, just these specific ones:
mongoc_collection_update()mongoc_collection_remove()mongoc_collection_delete()mongoc_collection_insert_bulk()mongoc_collection_insert()
like it's the friend who only texts back for five specific people π anyway, that's the list, and that's the vibe.
π RETURNS π
it gives you back a bson_t that you should not modify β or NULL. and heads up: that returned bson_t may be invalidated by the next operation on collection, so don't go holding onto it like it's a forever thing, it's giving situationship π₯π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
ok that's the whole page bestie, you ate that reading session, go forth and use the not deprecated functions fr fr πβπ
libmongoc, version 1.30.13, dated Oct 09, 2024 β mwah, love u, bye ππ¦β¨
π¦ where this page comes from
- fedora 43: mongo-c-driver-devel 1.30.13-1.fc43 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- fedora 43: mongo-c-driver-devel 1.30.13-1.fc43 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms