From b958513e453d362280e8fc842fb552785c842cb6 Mon Sep 17 00:00:00 2001 From: Katherine Walker Date: Fri, 26 Apr 2019 15:55:33 -0400 Subject: [PATCH] fix(command_result): return entire result in toJSON Fixes NODE-1942 --- lib/connection/command_result.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/connection/command_result.js b/lib/connection/command_result.js index be4eb52dd..762aa3f17 100644 --- a/lib/connection/command_result.js +++ b/lib/connection/command_result.js @@ -19,7 +19,9 @@ var CommandResult = function(result, connection, message) { * @return {object} */ CommandResult.prototype.toJSON = function() { - return this.result; + let result = Object.assign({}, this, this.result); + delete result.message; + return result; }; /**