Skip to content

Commit

Permalink
DOCSP-42530: Fix code sample (#900)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4918d9d)
  • Loading branch information
mcmorisi committed Aug 15, 2024
1 parent 809c77d commit f625b61
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source/code-snippets/monitoring/apm-subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const client = new MongoClient(uri, { monitorCommands:true });
const eventName = "<event name>";

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

async function run() {
try {
Expand Down

0 comments on commit f625b61

Please sign in to comment.