/
Stameskaaa
/
Server
Обзор
Документация
Войти
/
Stameskaaa
/
Server
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/mongodb/lib/operations/run_command.js
47 строк
1 KB
Stameskaaa
first
19 июн 2024, 15:02
19 июн 2024, 15:02
ac1472e
Код
Авторство
О чём код?
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RunAdminCommandOperation = exports.RunCommandOperation = void 0; const utils_1 = require("../utils"); const operation_1 = require("./operation"); /** @internal */ class RunCommandOperation extends operation_1.AbstractOperation { constructor(parent, command, options) { super(options); this.command = command; this.options = options; this.ns = parent.s.namespace.withCollection('$cmd'); } get commandName() { return 'runCommand'; } async execute(server, session) { this.server = server; return server.command(this.ns, this.command, { ...this.options, readPreference: this.readPreference, session }); } } exports.RunCommandOperation = RunCommandOperation; class RunAdminCommandOperation extends operation_1.AbstractOperation { constructor(command, options) { super(options); this.command = command; this.options = options; this.ns = new utils_1.MongoDBNamespace('admin', '$cmd'); } get commandName() { return 'runCommand'; } async execute(server, session) { this.server = server; return server.command(this.ns, this.command, { ...this.options, readPreference: this.readPreference, session }); } } exports.RunAdminCommandOperation = RunAdminCommandOperation; //# sourceMappingURL=run_command.js.map