MONGOC_BULKWRI...YOPTS_SET_HINT(3)

πŸ’… mongoc_bulkwrite_updatemanyopts_set_hint(3) πŸ’…

okay so bestie, welcome to libmongoc β€” yes, the C driver, yes we're doing this, and yes you're gonna slay it. this page is all about mongoc_bulkwrite_updatemanyopts_set_hint, which is a tiny little setter with main character energy. let's get into it 🫢


✨ SYNOPSIS ✨

void
mongoc_bulkwrite_updatemanyopts_set_hint (mongoc_bulkwrite_updatemanyopts_t *self, const bson_value_t *hint);

that's the whole vibe: no return value, just void, because this function is too iconic to hand anything back. it takes self (your update-many options, the star of the show πŸ’–) and hint (a const bson_value_t *, the supporting cast member doing the actual work).


🌸 DESCRIPTION 🌸

this is the "tell the server which index to use, bestie" function. literally its whole job. πŸ’…

you call it to specify the index to use. and because the universe loves options, you get two adorable ways to say it:

  • pass the index name as a string πŸŽ€
  • or pass the index key pattern πŸ¦‹

and here's the part that actually matters, no cap: if specified, then the query system will only consider plans using the hinted index. only that one. not the others. the others are not invited to the party 🚫✨

ngl, this is a hint and not a command, but the query planner takes it very seriously β€” it will only consider plans that use the hinted index once you've set one. that's exactly what the page says and i'm not making it up, promise πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

(actual legends, fr fr 🐐)


2009-present, MongoDB, Inc.


okay that's the whole page, you ate that πŸ“βœ¨ β€” and for the sign-off, the credit where it's due: this is libmongoc version 2.5.6, dated Oct 09, 202… which is where the header ran into the footer and cut the poor thing off 😭 (you've seen the last line, you know the vibe β€” the date just ran out of runway). love that for us. bye bestie, go hint some indexes πŸ’œπŸ¦‹

πŸ“¦ where this page comes from