* Executes a raw command only for MongoDB * * @param command * @returns
(command: Record<string, JsInputValue>)
| 614 | * @returns |
| 615 | */ |
| 616 | $runCommandRaw(command: Record<string, JsInputValue>) { |
| 617 | if (config.activeProvider !== 'mongodb') { |
| 618 | throw new PrismaClientValidationError( |
| 619 | `The ${config.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`, |
| 620 | { clientVersion: this._clientVersion }, |
| 621 | ) |
| 622 | } |
| 623 | |
| 624 | return this._createPrismaPromise((transaction) => { |
| 625 | return this._request({ |
| 626 | args: command, |
| 627 | clientMethod: '$runCommandRaw', |
| 628 | dataPath: [], |
| 629 | action: 'runCommandRaw', |
| 630 | argsMapper: rawCommandArgsMapper, |
| 631 | callsite: getCallSite(this._errorFormat), |
| 632 | transaction: transaction, |
| 633 | }) |
| 634 | }) |
| 635 | } |
| 636 | |
| 637 | /** |
| 638 | * Executes a raw query and returns selected data |