* 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)
| 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. |
nothing calls this directly
no test coverage detected