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β amongoc_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 π
π COPYRIGHT π
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
- 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