diff options
-rw-r--r-- | jstests/noPassthrough/currentop_query.js | 3 | ||||
-rw-r--r-- | src/mongo/db/commands/current_op.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/jstests/noPassthrough/currentop_query.js b/jstests/noPassthrough/currentop_query.js index 92c27d26d56..6d59aa5f07e 100644 --- a/jstests/noPassthrough/currentop_query.js +++ b/jstests/noPassthrough/currentop_query.js @@ -72,6 +72,9 @@ if (result.inprog.length === 1) { assert.eq(result.inprog[0].appName, "MongoDB Shell", tojson(result)); + assert.eq(result.inprog[0].clientMetadata.application.name, + "MongoDB Shell", + tojson(result)); return true; } diff --git a/src/mongo/db/commands/current_op.cpp b/src/mongo/db/commands/current_op.cpp index fd69d1c06a9..3a86aaabf31 100644 --- a/src/mongo/db/commands/current_op.cpp +++ b/src/mongo/db/commands/current_op.cpp @@ -150,6 +150,9 @@ public: if (!appName.empty()) { infoBuilder.append("appName", appName); } + + auto clientMetadataDocument = clientMetadata.get().getDocument(); + infoBuilder.append("clientMetadata", clientMetadataDocument); } // Operation context specific information |