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_t
  • mongoc_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 β€” a mongoc_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


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