MONGOC_CLIENT..._SNAPSHOT_TIME(3)
π MONGOC_CLIENT..._SNAPSHOT_TIME(3) β¨
okay so bestie, this one lives in libmongoc and it's literally the glow-up for your session's snapshot time π like, no cap.
πΈ SYNOPSIS πΈ
bool
mongoc_client_session_get_snapshot_time (const mongoc_client_session_t *session,
uint32_t *timestamp,
uint32_t *increment,
bson_error_t *error);
π DESCRIPTION π
So this function pulls the session's snapshot time and hands it to you as a BSON Timestamp, split all cute into a timestamp component and an increment component π«Ά.
Now, where does that snapshot time even come from? Two vibes only:
- it's the value you passed to
mongoc_session_opts_set_snapshot_time()when the session was started, or - it's the
atClusterTimethe server handed back on the session's very first read operation β and by read op I mean"find","aggregate"or"distinct"π
π¨ real talk: calling this function on a session that was not started withmongoc_session_opts_set_snapshot()set totrueis an error. periodt.
And if the session is a snapshot session but no snapshot time has been established yet β like, no read operation has completed and no snapshot time was configured β this function returns false without setting error. she just says nope, quietly π no drama, no error message.
π¦ PARAMETERS π¦
sessionβ Amongoc_client_session_t. the main character πtimestampβ A pointer to auint32_tto receive the timestamp component β¨incrementβ A pointer to auint32_tto receive the increment component β¨errorβ An optional location for abson_error_t, orNULLπ
π RETURNS π
Returns true and populates timestamp and increment if the snapshot time is available β slay, it worked π. Returns false otherwise, and sets error if the session is not a snapshot session π
β AUTHOR β
MongoDB, Inc β the icons behind it all π
π COPYRIGHT π
2009-present, MongoDB, Inc. π«Ά
and that's the whole tea, bestie π§π β this page was brought to you by libmongoc 2.5.6, dated Oct 09, 2026, ilysm, go forth and snapshot responsibly β¨π
π¦ 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