MONGOC_BULKWRITERETURN_T(3)

πŸ’… MONGOC_BULKWRITERETURN_T(3) πŸ’…

okay bestie, welcome to the <pink>libmongoc</pink> docs, where we're talking about mongoc_bulkwritereturn_t β€” it's the little bundle of "how did my bulk write go" that comes back to you. she's the receipt after the shopping spree, yk? 🧾✨

✨ SYNOPSIS ✨

typedef struct {
  mongoc_bulkwriteresult_t *res;    // NULL if no known successful writes or write was unacknowledged.
  mongoc_bulkwriteexception_t *exc; // NULL if no error.
} mongoc_bulkwritereturn_t;

that's her. two pointers, zero drama (well, exc might have some drama, but we'll get there 🫢).

πŸ’– DESCRIPTION πŸ’–

so mongoc_bulkwritereturn_t is the struct you get handed back by mongoc_bulkwrite_execute(). iconic behavior honestly. πŸ”₯

okay, important lore: res or exc may outlive the mongoc_bulkwrite_t that was executed. like, they're independent girlies β€” the bulkwrite can be gone and these are still valid. no cap. πŸ¦‹

res is NULL if the mongoc_bulkwrite_t has no known successful writes, or if it was executed with an unacknowledged write concern. so like, no news is... no res. 😭

res must be freed with mongoc_bulkwriteresult_destroy(). don't forget, bestie β€” she's not gonna clean up after herself. πŸŽ€

exc is NULL if no error occurred. love that for you. ✨

exc must be freed with mongoc_bulkwriteexception_destroy(). separately! her own little cleanup ritual. πŸ’…

lowkey the whole vibe here: check which one is NULL, use the other one, then destroy whichever ones exist. that's it, that's the tea. πŸ“

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the iconique mothership herself. πŸ’œ

2009-present, MongoDB, Inc. β€” fr fr, all rights reserved since way back. 🫢


and that's the whole page, bestie! sign-off time: this was <hotpink>libmongoc</hotpink> version <yellow>2.5.6</yellow>, dated <cyan>Oct 09, 2026</cyan>. go forth and free your pointers πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from