Skip to content

Commit 3cd0982

Browse files
committed
DOCSP-42530: Fix code sample (#900)
(cherry picked from commit 4918d9d)
1 parent e692d37 commit 3cd0982

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

source/code-snippets/monitoring/apm-subscribe.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ const client = new MongoClient(uri, { monitorCommands:true });
1111
const eventName = "<event name>";
1212

1313
// Subscribe to a specified event and print a message when the event is received
14-
client.on(eventName, event => {
15-
console.log(`received ${eventName}: ${JSON.stringify(event, null, 2)}`);
16-
});
14+
client.on(eventName, event => console.log(event));
1715

1816
async function run() {
1917
try {

0 commit comments

Comments
 (0)