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

Add an example for how to implement cursor.hasNext functionality

    XMLWordPrintableJSON

Details

    Description

      As discussed in mongodb-user: https://groups.google.com/forum/#!topic/mongodb-user/a0gbKkSLvxU

      There isn't a great way to check if a cursor has another document to be iterated. mongoc_cursor_more isn't sufficient, since it doesn't actually contact the server, and returns true if the cursor is still open or has not yet been primed.

      Let's formalize the workaround offered on the user group thread and make an official example for this in our documentation.

      Attachments

        Activity

          People

            adrian.dole@mongodb.com Adrian Dole
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: