Skip to content

Commit

Permalink
fix(apm): give users access to raw server responses
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mbroadst committed Nov 17, 2017
1 parent fbad159 commit 88b206b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/apm.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,9 @@ var Instrumentation = function(core, options, callback) {
// Emit the command
self.emit('failed', command);
} else {
// Do we have a getMore
if (commandName.toLowerCase() === 'getmore' && r == null) {
if (r && r.documents) {
r = r.documents[0];
} else if (commandName.toLowerCase() === 'getmore' && r == null) {
r = {
cursor: {
id: cursor.cursorState.cursorId,
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,14 @@ mongodb-core@2.1.17:

mongodb-core@mongodb-js/mongodb-core#3.0.0:
version "3.0.0-beta1"
resolved "https://codeload.github.com/mongodb-js/mongodb-core/tar.gz/d7cd5cdda5fddc8635353063d245fb083ef1d545"
resolved "https://codeload.github.com/mongodb-js/mongodb-core/tar.gz/69994597bd354c9945d0f47fe4abfb917448ace1"
dependencies:
bson "~1.0.4"
require_optional "^1.0.1"

mongodb-core@mongodb-js/mongodb-core#causally-consistent-reads:
version "3.0.0-beta1"
resolved "https://codeload.github.com/mongodb-js/mongodb-core/tar.gz/67b10c1f9175851496f5675ad18171466079dccc"
dependencies:
bson "~1.0.4"
require_optional "^1.0.1"
Expand Down

0 comments on commit 88b206b

Please sign in to comment.