Skip to content

Conversation

vkarpov15
Copy link
Collaborator

Fix #14611

Summary

MongoDB driver introduced a handy set of commandStarted, commandFailed, commandSucceeded events that are great for monitoring performance. With this PR, we'll bubble those events up to the Mongoose connection if the monitorCommands option is set.

We shouldn't need to add monitorCommands to Mongoose's ConnectOptions because monitorCommands is already an option in MongoDB driver's connection options: https://github.com/mongodb/node-mongodb-native/blob/8fb43f86b22f98e488a3a98c0b562ca240ffdaa1/src/cmap/connection.ts#L118

Examples

@vkarpov15 vkarpov15 added this to the 8.5 milestone Jun 21, 2024
@vkarpov15 vkarpov15 merged commit da15836 into 8.5 Jun 24, 2024
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14611 branch June 24, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants