MONGOC_CLIENT_...OPERATION_TIME(3)
π
MONGOC_CLIENT_...OPERATION_TIME(3) β like, the advance_operation_time glow-up β¨
okay so this is a page from libmongoc (yes, the C driver for MongoDB, she's iconic) and the star of the show is mongoc_client_session_advance_operation_time(). the title got a little mangled into MONGOC_CLIENT_...OPERATION_TIME(3) but don't let that fool you, the whole function name is right down there β¬οΈ π«Ά
β¨ SYNOPSIS β¨
void
mongoc_client_session_advance_operation_time (mongoc_client_session_t *session,
uint32_t timestamp,
uint32_t increment);
so she's void, she takes three things, and she returns absolutely nothing β no notes, no drama, no return value. main character energy fr π
bestie, here's the vibe: this function advances the session's operation time, and that operation time is expressed as a BSON Timestamp made up of a timestamp component and an increment component. two little pieces, one big vibe. π
β οΈ the actual tea: this only does anything if the new operation time is greater than the session's current operation time. if you try to move it backwards? nothing happens. she said "not today" π
and here's the combo move you actually want: use mongoc_client_session_advance_operation_time() together with mongoc_client_session_advance_cluster_time() to copy the operationTime and clusterTime from another session. why? so that subsequent operations in this session are causally consistent with the last operation in that other session. it's giving passing the aux cord so both sessions are on the same track π§β¨
π PARAMETERS π
sessionβ amongoc_client_session_t. your session. the one you're advancing. π«Άtimestampβ the timestamp component of the newoperationTime. π°οΈincrementβ the increment component of the newoperationTime. like the timestamp's little sidekick π₯
π AUTHOR π
MongoDB, Inc β yes, that MongoDB. slay.
π COPYRIGHT π
2009-present, MongoDB, Inc. β iconic longevity, no cap.
and that's the whole page, bestie! this one came to you from libmongoc, version 2.5.6, dated Oct 09 (the year in the footer got cut off mid-number, so likeβ¦ she's mysterious π). go forth and be causally consistent πβ¨ππ¦
π¦ 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