Skip to content

Commit

Permalink
DOCSP-42530: Fix code sample
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmorisi committed Aug 14, 2024
1 parent e955361 commit 2f93ff9
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 2f93ff9

Please sign in to comment.