[CDRIVER-516] Clear instructions for mongoc_cursor_more Created: 23/Jan/15  Updated: 19/Oct/16  Resolved: 08/Sep/16

Status: Closed
Project: C Driver
Component/s: docs, libmongoc
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Bug Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CDRIVER-708 mongoc_cursor_more doesn't work as ex... Closed

 Description   

(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?



 Comments   
Comment by Githook User [ 08/Sep/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-516 improve mongoc_cursor_more docs
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c4d9ae5a98a5eeb540d5d1815f5cea52519ee02a

Comment by A. Jesse Jiryu Davis [ 25/Feb/15 ]

May be a docs / examples issue - mongoc_cursor_next is reliable whereas mongoc_cursor_more cannot be perfectly reliable, the collection may change on the server between calls

Generated at Wed Feb 07 21:09:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.