Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
fix(cursor): callback with server response on _find
Browse files Browse the repository at this point in the history
This allows us to properly include the server reply in APM events
in the porcelain driver
  • Loading branch information
mbroadst committed Nov 15, 2017
1 parent d7cd5cd commit 6999459
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ Cursor.prototype._find = function(callback) {
}

// Return after processing command cursor
return callback(null, null);
return callback(null, result);
}

if (Array.isArray(result.documents[0].result)) {
self.cursorState.documents = result.documents[0].result;
self.cursorState.cursorId = Long.ZERO;
return callback(null, null);
return callback(null, result);
}
}

Expand All @@ -260,7 +260,7 @@ Cursor.prototype._find = function(callback) {
}

// Return callback
callback(null, null);
callback(null, result);
};

// Options passed to the pool
Expand Down

0 comments on commit 6999459

Please sign in to comment.