MONGOC_CURSOR_CLONE(3)

πŸ’… MONGOC_CURSOR_CLONE(3) πŸ’…

okay so bestie, welcome to the libmongoc manual page for mongoc_cursor_clone β€” this is the one, this is THE icon, the moment, the clone arc we've all been waiting for 🧬✨


✨ SYNOPSIS ✨

mongoc_cursor_t *
mongoc_cursor_clone (const mongoc_cursor_t *cursor);

like, that's literally the whole vibe check right there 🫢


🌸 PARAMETERS 🌸

  • cursor β€” a mongoc_cursor_t. that's it. that's the whole parameter list, she's a simple queen πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function shall create a copy of a mongoc_cursor_t. no cap, an actual copy, she's giving twin energy πŸ’…

the cloned cursor gets reset to the beginning of the query, which means the query will be re-executed on the MongoDB server when mongoc_cursor_next() is called. so like, it's not a lazy copy sitting there doing nothing β€” the moment you hit next(), the server's doing the work all over again πŸ”₯

iykyk, that's the important bit: re-execution on the server. not a free lunch, just a fresh start ✨


πŸŽ€ RETURNS πŸŽ€

you get a newly allocated mongoc_cursor_t β€” a whole new cursor, freshly allocated, main character energy πŸ‘‘

and like any new cursor bestie, she should be freed with mongoc_cursor_destroy() when no longer in use. don't leave her hanging, that's rude πŸ™ˆ

WARNING: failure to handle the result of this function is a programming error. like, fr fr, that's a programming error, not a cute little oopsie πŸ’€ handle your return values, bestie!!

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icon, the legend, the moment πŸ†


2009-present, MongoDB, Inc. β€” slay, protecting the intellectual property since 2009 πŸ’œ


and that's the page, bestie!! πŸ“ this was libmongoc manual page MONGOC_CURSOR_CLONE(3), version 2.5.6, dated Oct 09, 2026 β€” go forth and clone responsibly, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from