MONGOC_QUERY_FLAGS_T(3)

πŸ’… MONGOC_QUERY_FLAGS_T(3) β€” Flags for query operations ✨

okay so this is a page from libmongoc (that's the MongoDB C driver, iykyk) and it's literally just about MONGOC_QUERY_FLAGS_T(3) β€” the little enum of query flags. it's short, it's sweet, and bestie you're gonna get it in like two minutes fr fr 🫢


🌸 SYNOPSIS 🌸

typedef enum {
   MONGOC_QUERY_NONE = 0,
   MONGOC_QUERY_TAILABLE_CURSOR = 1 << 1,
   MONGOC_QUERY_SECONDARY_OK = 1 << 2,
   MONGOC_QUERY_OPLOG_REPLAY = 1 << 3,
   MONGOC_QUERY_NO_CURSOR_TIMEOUT = 1 << 4,
   MONGOC_QUERY_AWAIT_DATA = 1 << 5,
   MONGOC_QUERY_EXHAUST = 1 << 6,
   MONGOC_QUERY_PARTIAL = 1 << 7,
} mongoc_query_flags_t;

like, look at those bit shifts. chef's kiss. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so these flags are the ones that correspond to the MongoDB wire protocol β€” no cap, that's literally what they are. πŸ’–

you can bitwise-or them together (yes, | them, that's the move), and they may modify how a query is performed in the MongoDB server. that's the whole vibe check.


πŸŽ€ FLAG VALUES πŸŽ€

okay here's the lineup, one by one, no skips:

  • MONGOC_QUERY_NONE β€” specify no query flags. it's the nothing girlie. the blank slate. the = 0.
  • MONGOC_QUERY_TAILABLE_CURSOR β€” the cursor will not be closed when the last data is retrieved, so you can resume this cursor later. it's giving "don't leave, i'm not done talking" energy 😭
  • MONGOC_QUERY_SECONDARY_OK β€” allow query of replica set secondaries. let the side characters speak, honestly 🫢
  • MONGOC_QUERY_OPLOG_REPLAY β€” used internally by MongoDB. main character behaviour that you're not invited to, bestie, and that's fine πŸ’…
  • MONGOC_QUERY_NO_CURSOR_TIMEOUT β€” okay so normally the server times out an idle cursor after an inactivity period (10 minutes). this prevents that. your cursor stays unbothered, moisturized, in its lane ✨
  • MONGOC_QUERY_AWAIT_DATA β€” use this with MONGOC_QUERY_TAILABLE_CURSOR. it'll block rather than returning no data, and after a period, it times out. patient but not that patient 🌸
  • MONGOC_QUERY_EXHAUST β€” unused. that's it. that's the whole description. it's the forgotten sibling πŸ’€
  • MONGOC_QUERY_PARTIAL β€” get partial results from mongos if some shards are down (instead of throwing an error). like, you take what you can get instead of having a whole meltdown πŸ”₯
⚠️ quick vibe-check warning for you: these flags correspond to the wire protocol and may modify how a query is performed in the MongoDB server β€” so know what you're or-ing together before you send it. πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” yeah, them. the whole house.


2009-present, MongoDB, Inc.


⭐ alright bestie that's the whole page, you ate it up. this came from libmongoc version 2.5.6, dated Oct 09, 2026 β€” screenshot it, cite it, live your truth πŸ’–πŸ¦‹πŸŒˆπŸ“πŸ§š

πŸ“¦ where this page comes from