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 β€” a mongoc_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't bson_destroy it, 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 πŸ‘‘


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