MONGOC_READ_P...LENESS_SECONDS(3)

πŸ’… MONGOC_READ_P...LENESS_SECONDS πŸ’…

Okay bestie, so this is a libmongoc function and honestly? It's a little one-trick pony but it slays at its one trick. Sit down, hydrate, let's go 🫢


✨ SYNOPSIS ✨

int64_t
mongoc_read_prefs_get_max_staleness_seconds (
   const mongoc_read_prefs_t *read_prefs);

Like, that's it. That's the whole vibe. It returns an int64_t, it takes one pointer, nobody's getting hurt 😌


πŸŽ€ PARAMETERS πŸŽ€

  • read_prefs β€” a mongoc_read_prefs_t. Yep. That's the whole parameter list. One (1) single read prefs struct, hand it over and let the function do its thing πŸ¦‹

🌸 DESCRIPTION 🌸

Okay so here's the lore, and ngl it's kinda iconic πŸ‘‘

Clients estimate the staleness of each secondary β€” like, they're doing a little vibe check on how out-of-date each one is β€” and then they select for reads only those secondaries whose estimated staleness is less than or equal to maxStalenessSeconds πŸ’–

So if a secondary is too stale? Not invited to the read party. Sorry babe πŸ’€

And the default? The default is MONGOC_NO_MAX_STALENESS. That's the whole default. No max, no limit, no cap (literally β€” well, no staleness cap, which is different from the slang "no cap", but you get me πŸ™ˆ).


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the ones who brought you the whole thing πŸ“


2009-present, MongoDB, Inc. β€” long-running, dedicated, committed. main character energy fr fr 🌈


✨ friendly reminder bestie: this function just gets the max staleness seconds. It doesn't set anything, it doesn't validate anything, it just reports what's there. Read the room, then read the read prefs πŸ’…

okay that's the page!! this was libmongoc version 2.5.6, dated Oct 09, 2026 β€” go forth and get those staleness seconds, you absolute icon πŸŒŸπŸ’–πŸŽ€

πŸ“¦ where this page comes from