MONGOC_CURSOR_CURRENT(3)
β¨ MONGOC_CURSOR_CURRENT β¨
okay bestie, welcome to MONGOC_CURSOR_CURRENT(3) π β yes, the whole page lives under the libmongoc manual, and it's genuinely one of the shortest little slays in the whole cursor saga. ngl it's giving "small but mighty" energy π¦
πΈ SYNOPSIS πΈ
const bson_t *
mongoc_cursor_current (const mongoc_cursor_t *cursor);
like, that's it. that's the whole vibe. two lines of C and it's already iconic π
π PARAMETERS π
cursorβ amongoc_cursor_t. yeah, that one. the cursor you're currently obsessed with π«Ά
π§ DESCRIPTION π§
okay so here's the tea β β this function fetches the cursor's current document. literally just hands you whatever doc the cursor is sitting on right now. no drama, no extra steps, no cap π―
but bestie, listen π β if there's been an error, you get NULL instead. not a doc, not a vibe, just NULL. so do a little vibe check on that return value before you go dereferencing anything, mwah π
π RETURNS π
- a
bson_tβ that should not be modified or freed π like, hands off, it's not yours, don't touch it, don'tbson_destroyit, don't edit it. just look at it respectfully π - or
NULLβ if something went sideways π
fr fr, that "should not be modified or freed" part is real. that bson_t is borrowed, not gifted. you modify it or free it and you're gonna have a bad time π
π AUTHOR π
MongoDB, Inc β the actual masterminds behind this whole thing π
π COPYRIGHT π
2009-present, MongoDB, Inc. all the rights, all the reserved, periodt π
k bye ily, go read your cursors responsibly πβ¨ β this cute lil sign-off brought to you by libmongoc version 2.5.6, dated Oct 09, 2026 ππ¦π
π¦ 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