MONGOC_BULK_OPERATION_SET_HINT(3)

πŸ’– MONGOC_BULK_OPERATION_SET_HINT πŸ’–

okay bestie, welcome to the libmongoc manual, section 3 β€” this one's a lil vintage, a lil deprecated, and we're gonna get through it together 🫢


🚨 WARNING 🚨

Deprecated since version 1.28.0 β€” girl, she's retired. Use mongoc_bulk_operation_set_server_id() instead. no cap. πŸ’€

✨ SYNOPSIS ✨

void
mongoc_bulk_operation_set_hint (mongoc_bulk_operation_t *bulk, uint32_t server_id);

that's the whole vibe right there ⬆️


πŸŽ€ PARAMETERS πŸŽ€

  • bulk β€” a mongoc_bulk_operation_t. that's the thing you're operating on, your main character 🫢
  • server_id β€” an opaque id that identifies which server to use. opaque meaning you don't peek inside it, you just hold it and pass it along, iykyk 🌸

πŸ’… DESCRIPTION πŸ’…

So basically, this function tells the driver which server to use for the operation. that's it, that's the job ✨

⚠️ it only does anything if you call it before mongoc_bulk_operation_execute(). call it after and it's giving nothing, literally nothing, the window has closed 😭

now, about the name β€” the function name still has the old term "hint" in it purely for the sake of backward compatibility. the way that we now call this number a "server id". same number, new glow-up. it's iconic honestly πŸ‘‘

and here's the part you actually need to hear: use mongoc_bulk_operation_set_hint only for building a language driver that wraps the C Driver. that's the whole audience, that's the whole point of her 🧚

if you're writing applications in C? leave the server id unset, bestie. just let the driver choose a suitable server for the bulk operation. she knows what she's doing, trust her 🌈


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc


2009-present, MongoDB, Inc.


and that's the page, babe πŸ’– this was libmongoc version 1.30.13, dated Oct 09, 2026 β€” thanks for reading, go forth and let the driver pick your server for you πŸ¦‹βœ¨

πŸ“¦ where this page comes from