MONGOC_UPDATE_FLAGS_T(3)

πŸ¦‹ MONGOC_UPDATE_FLAGS_T(3) β€” libmongoc, bestie edition ✨

Okay so this is the whole flags for update operations situation, and honestly? It's a vibe. This is libmongoc lore and we're getting into it. 🌸


✨ SYNOPSIS ✨

Here's the tea, literally copy-pasted because code does NOT get the group-chat treatment:

typedef enum {
   MONGOC_UPDATE_NONE = 0,
   MONGOC_UPDATE_UPSERT = 1 << 0,
   MONGOC_UPDATE_MULTI_UPDATE = 1 << 1,
} mongoc_update_flags_t;

#define MONGOC_UPDATE_NO_VALIDATE (1U << 31)

No notes, she ate. πŸ’…


πŸ’– DESCRIPTION πŸ’–

So these flags correspond to the MongoDB wire protocol β€” like, they're the actual bits talking to the server, no cap. You can bitwise or'd them together however you want (yes, or'd, that's the actual word, we love a slightly cursed grammar moment 🫢).

The way that they work is they let you modify the way an update is performed in the MongoDB server. That's it, that's the whole job. Main character energy for a tiny enum. πŸ‘‘


πŸŽ€ FLAG VALUES πŸŽ€

Okay bestie, here's the roster, one bullet at a time because tables are not the moment:

  • MONGOC_UPDATE_NONE β€” literally no update flags set. The blank slate. The "I'm just here" of flags. πŸ“
  • MONGOC_UPDATE_UPSERT β€” tells the server whether an upsert should be performed. Yes upsert. Yes it's a real word here.
  • MONGOC_UPDATE_MULTI_UPDATE β€” for when more than a single matching document should be updated. And listen, the default is lowkey stingy: by default only the first document is updated. So if you wanted everything touched, you gotta say so. πŸ™ˆ
  • MONGOC_UPDATE_NO_VALIDATE β€” do not perform client side BSON validations when performing an update. Super useful if you already know your BSON documents are valid, and honestly if you know, you know β€” iykyk. ⭐
Real talk though: that last one is defined as #define MONGOC_UPDATE_NO_VALIDATE (1U << 31), so it lives way out there in the high bits. Not a "fix", just a fact. πŸ’€

🌈 AUTHOR 🌈

MongoDB, Inc β€” iconic, no further questions. πŸ‘‘


2009-present, MongoDB, Inc. β€” protecting the brand since '09, periodt. πŸ’œ


Okay that's the whole page, you're so welcome, go update something responsibly. πŸŒΈπŸ¦‹

Sign-off realness: this was version 2.5.6, dated Oct 09, 2026, from the MONGOC_UPDATE_FLAGS_T(3) page in the libmongoc manual β€” mwah, catch you in the next one πŸ’…βœ¨

πŸ“¦ where this page comes from