MCPcopy
hub / github.com/mongodb/node-mongodb-native / withoutCommandMonitoring

Function withoutCommandMonitoring

test/tools/spec-runner/index.js:629–639  ·  view source on GitHub ↗
(client, fn)

Source from the content-addressed store, hash-verified

627}
628
629function withoutCommandMonitoring(client, fn) {
630 const listeners = client.rawListeners('commandStarted');
631 client.removeAllListeners('commandStarted');
632 return Promise.resolve()
633 .then(() => fn())
634 .finally(() => {
635 for (const listener of listeners) {
636 client.on('commandStarted', listener);
637 }
638 });
639}
640
641const kOperations = new Map([
642 [

Callers 1

index.jsFile · 0.85

Calls 4

rawListenersMethod · 0.80
removeAllListenersMethod · 0.80
onMethod · 0.80
fnFunction · 0.50

Tested by

no test coverage detected