Skip to content

Commit 88b206b

Browse files
committed
fix(apm): give users access to raw server responses
We were building server responses if the reply was `null`, which was only the case for some primitives which we were not passing up to the porcelain driver. Now we are doing that, so there should be no need to hand craft responses. NODE-1190
1 parent fbad159 commit 88b206b

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

lib/apm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,9 @@ var Instrumentation = function(core, options, callback) {
516516
// Emit the command
517517
self.emit('failed', command);
518518
} else {
519-
// Do we have a getMore
520-
if (commandName.toLowerCase() === 'getmore' && r == null) {
519+
if (r && r.documents) {
520+
r = r.documents[0];
521+
} else if (commandName.toLowerCase() === 'getmore' && r == null) {
521522
r = {
522523
cursor: {
523524
id: cursor.cursorState.cursorId,

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,14 @@ mongodb-core@2.1.17:
21102110

21112111
mongodb-core@mongodb-js/mongodb-core#3.0.0:
21122112
version "3.0.0-beta1"
2113-
resolved "https://codeload.github.com/mongodb-js/mongodb-core/tar.gz/d7cd5cdda5fddc8635353063d245fb083ef1d545"
2113+
resolved "https://codeload.github.com/mongodb-js/mongodb-core/tar.gz/69994597bd354c9945d0f47fe4abfb917448ace1"
2114+
dependencies:
2115+
bson "~1.0.4"
2116+
require_optional "^1.0.1"
2117+
2118+
mongodb-core@mongodb-js/mongodb-core#causally-consistent-reads:
2119+
version "3.0.0-beta1"
2120+
resolved "https://codeload.github.com/mongodb-js/mongodb-core/tar.gz/67b10c1f9175851496f5675ad18171466079dccc"
21142121
dependencies:
21152122
bson "~1.0.4"
21162123
require_optional "^1.0.1"

0 commit comments

Comments
 (0)