From 69994597bd354c9945d0f47fe4abfb917448ace1 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Tue, 14 Nov 2017 21:23:16 -0500 Subject: [PATCH] fix(cursor): callback with server response on `_find` This allows us to properly include the server reply in APM events in the porcelain driver --- lib/cursor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cursor.js b/lib/cursor.js index ea3051a7e..5eb1196c0 100644 --- a/lib/cursor.js +++ b/lib/cursor.js @@ -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); } } @@ -260,7 +260,7 @@ Cursor.prototype._find = function(callback) { } // Return callback - callback(null, null); + callback(null, result); }; // Options passed to the pool