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

Function validateExplainTimeoutOptions

src/explain.ts:93–98  ·  view source on GitHub ↗
(options: Document, explain?: Explain)

Source from the content-addressed store, hash-verified

91}
92
93export function validateExplainTimeoutOptions(options: Document, explain?: Explain) {
94 const { maxTimeMS, timeoutMS } = options;
95 if (timeoutMS != null && (maxTimeMS != null || explain?.maxTimeMS != null)) {
96 throw new MongoAPIError('Cannot use maxTimeMS with timeoutMS for explain commands.');
97 }
98}
99
100/**
101 * Applies an explain to a given command.

Callers 3

_initializeMethod · 0.90
_initializeMethod · 0.90
constructorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected