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. π
π§ COPYRIGHT π§
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
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms