Skip to content

Commit

Permalink
fix(apm): rebuild lost cursor info on pre-OP_QUERY responses
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 20, 2017
1 parent 416497a commit 4242d49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/apm.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,9 @@ var Instrumentation = function(core, options, callback) {
} else {
if (r && r.documents) {
r = r.documents[0];
} else if (commandName.toLowerCase() === 'getmore' && r == null) {
}

if (commandName.toLowerCase() === 'getmore' && r.cursor == null) {
r = {
cursor: {
id: cursor.cursorState.cursorId,
Expand All @@ -531,7 +533,7 @@ var Instrumentation = function(core, options, callback) {
(commandName.toLowerCase() === 'find' ||
commandName.toLowerCase() === 'aggregate' ||
commandName.toLowerCase() === 'listcollections') &&
r == null
r.cursor == null
) {
r = {
cursor: {
Expand Down

0 comments on commit 4242d49

Please sign in to comment.