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

Method command

src/db.ts:273–289  ·  view source on GitHub ↗

* Execute a command * * @remarks * This command does not inherit options from the MongoClient. * * The driver will ensure the following fields are attached to the command sent to the server: * - `lsid` - sourced from an implicit session or options.session * - `$readPreference` -

(command: Document, options?: RunCommandOptions & Abortable)

Source from the content-addressed store, hash-verified

271 * @param options - Optional settings for the command
272 */
273 async command(command: Document, options?: RunCommandOptions & Abortable): Promise<Document> {
274 // Intentionally, we do not inherit options from parent for this operation.
275 return await executeOperation(
276 this.client,
277 new RunCommandOperation(
278 this.s.namespace,
279 command,
280 resolveOptions(undefined, {
281 ...resolveBSONOptions(options),
282 timeoutMS: options?.timeoutMS ?? this.timeoutMS,
283 session: options?.session,
284 readPreference: options?.readPreference,
285 signal: options?.signal
286 })
287 )
288 );
289 }
290
291 /**
292 * Execute an aggregation framework pipeline against the database.

Callers

nothing calls this directly

Calls 3

executeOperationFunction · 0.90
resolveOptionsFunction · 0.90
resolveBSONOptionsFunction · 0.90

Tested by

no test coverage detected