lib/operations/cursor_ops.js
function next(cursor, callback) {
  // Return the currentDoc if someone called hasNext first
  if (cursor.s.currentDoc) {
    const doc = cursor.s.currentDoc;
    cursor.s.currentDoc = null;
    return callback(null, doc);
  }

  // Return the next object
  nextObject(cursor, callback);
}
function next(cursor, callback) {
  // Return the currentDoc if someone called hasNext first
  if (cursor.s.currentDoc) {
    const doc = cursor.s.currentDoc;
    cursor.s.currentDoc = null;
    return callback(null, doc);
  }

  // Return the next object
  nextObject(cursor, callback);
}
function next ( cursor , callback ) { // Return the currentDoc if someone called hasNext first if ( cursor . s . currentDoc ) { const doc = cursor . s . currentDoc ; cursor . s . currentDoc = null ; return callback ( null , doc ) ; } // Return the next object nextObject ( cursor , callback ) ; }
Get the next available document from the cursor. Returns null if no more documents are available.

@method
@param {Cursor} cursor The Cursor instance from which to get the next document.
@param {Cursor~resultCallback} [callback] The result callback.
Get the next available document from the cursor . Returns null if no more documents are available .