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

Method command

src/admin.ts:76–86  ·  view source on GitHub ↗

* Execute a command * * 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` - defaults to primary or can be configured by options.readPreference * - `$db` - s

(command: Document, options?: RunCommandOptions)

Source from the content-addressed store, hash-verified

74 * @param options - Optional settings for the command
75 */
76 async command(command: Document, options?: RunCommandOptions): Promise<Document> {
77 return await executeOperation(
78 this.s.db.client,
79 new RunCommandOperation(new MongoDBNamespace('admin'), command, {
80 ...resolveBSONOptions(options),
81 session: options?.session,
82 readPreference: options?.readPreference,
83 timeoutMS: options?.timeoutMS ?? this.s.db.timeoutMS
84 })
85 );
86 }
87
88 /**
89 * Retrieve the server build information

Callers 5

buildInfoMethod · 0.95
serverInfoMethod · 0.95
serverStatusMethod · 0.95
pingMethod · 0.95
replSetGetStatusMethod · 0.95

Calls 2

executeOperationFunction · 0.90
resolveBSONOptionsFunction · 0.90

Tested by

no test coverage detected