Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-516

Clear instructions for mongoc_cursor_more

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: Docs, libmongoc
    • None

      (ported from github)

      I have some code that used mongoc_cursor_more() to detect end of data in version 0.9.0 and appeared to work correctly.

      It is basically structured like:

      while(mongoc_cursor_more(c))
      {
         if(mongoc_cursor_next(c, &bdoc))
         {
            // do stuff
         }
         else
         {
            // handle presumed error
         }
      }
      

      However, I am upgrading to 0.98.0 and now it appears that mongoc_cursor_more() always returns true, even when mongoc_cursor_next() indicates that the cursor is exhausted. I have to examine the cursor error and find it set to 0 to detect end of data. Is this a bug or am I missing something?

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: