MONGOC_CURSOR_MORE(3)

πŸ’… MONGOC_CURSOR_MORE(3) β€” the libmongoc glow-up

okay bestie, welcome to the libmongoc corner of the manual, and today's main character is mongoc_cursor_more(3). she's short, she's simple, and honestly she's a little bit of a liar β€” but we'll get to that. πŸŽ€


✨ SYNOPSIS ✨

bool
mongoc_cursor_more (mongoc_cursor_t *cursor);

🌸 PARAMETERS 🌸

  • cursor β€” a mongoc_cursor_t. that's it. that's the whole parameter list. periodt. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this function shall indicate if there's potentially more data to be read from the cursor. key word: potentially. this is lowkey only useful with tailable cursors. for regular cursors, bestie, use mongoc_cursor_next() β€” that's the one you actually want. 🫢

πŸ’€ the details (read these, fr fr)

mongoc_cursor_more is unreliable because it does not contact the server to see if there are actually more documents in the result set. nope. not even a little peek. it simply returns true if:

  • the cursor has not begun, or
  • it has begun and there are buffered documents in the client-side cursor, or
  • it has begun and the server has not yet told the cursor it is completely iterated.

that's the whole vibe check. πŸ™ˆ

⚠️ and it's unreliable with regular queries too, because it returns true for a new cursor before iteration β€” even if the cursor will match no documents at all. literally giving "yes babe there's definitely more" energy with zero receipts. 😭

it's also true if:

  • the collection has been dropped on the server since the previous fetch, or
  • the cursor has finished its final batch and the next batch will be empty.

so yeah. she's confident, she's just not always correct. πŸ’€


⭐ RETURNS ⭐

true if the cursor has locally-buffered documents, or if a round-trip to the server might fetch additional documents.

that "might" is doing soooo much work in that sentence, iykyk. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

  • Tailable Cursor Example

go read it, it's giving tutorial energy and it slaps. 🧚


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc


2009-present, MongoDB, Inc.


and that's the whole page, bestie β€” version 2.5.6, dated Oct 09, 2026, straight from the MONGOC_CURSOR_MORE(3) manual. slay, stay buffered, and check your cursor before you trust it. πŸ’–βœ¨

πŸ“¦ where this page comes from