* 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)
| 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 |
no test coverage detected