-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
command events are not fired after setting monitorCommands: true #14611
Comments
Use the following instead: const client = mongoose.connection.client;
client.on('commandStarted', event => console.log(event));
client.on('commandFailed', event => console.log(event));
client.on('commandSucceeded', event => console.log(event));
That being said, we will keep this issue open for 8.5 because it would by nice for Mongoose to bubble up the |
Yeah |
…tion if `monitorCommands` option set Fix #14611
feat(connection): bubble up monitorCommands events to Mongoose connection if `monitorCommands` option set
Prerequisites
Mongoose version
8.4.0
Node.js version
18.19.1
MongoDB server version
6.0.1
Typescript version (if applicable)
No response
Description
MongoDB dirver supports Command Monitoring
Problem: unable to subscribe for command monitoring events using mongoose
Steps to Reproduce
using
[email protected]
After following setup steps from the doc above, events are not emitted / reaching event listeners
Expected Behavior
but when using
[email protected]
directly which is installed together with[email protected]
Events are fired and able to reach event listeners
The text was updated successfully, but these errors were encountered: