Server IP : 162.213.251.212 / Your IP : 18.222.50.201 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/allssztx/needapair.com/node_modules/mongodb/src/operations/ |
Upload File : |
import type { BSONSerializeOptions, Document } from '../bson'; import { type MongoDBResponseConstructor } from '../cmap/wire_protocol/responses'; import { type Db } from '../db'; import { type TODO_NODE_3286 } from '../mongo_types'; import type { ReadPreferenceLike } from '../read_preference'; import type { Server } from '../sdam/server'; import type { ClientSession } from '../sessions'; import { MongoDBNamespace } from '../utils'; import { AbstractOperation } from './operation'; /** @public */ export type RunCommandOptions = { /** Specify ClientSession for this command */ session?: ClientSession; /** The read preference */ readPreference?: ReadPreferenceLike; } & BSONSerializeOptions; /** @internal */ export class RunCommandOperation<T = Document> extends AbstractOperation<T> { constructor( parent: Db, public command: Document, public override options: RunCommandOptions & { responseType?: MongoDBResponseConstructor } ) { super(options); this.ns = parent.s.namespace.withCollection('$cmd'); } override get commandName() { return 'runCommand' as const; } override async execute(server: Server, session: ClientSession | undefined): Promise<T> { this.server = server; const res: TODO_NODE_3286 = await server.command( this.ns, this.command, { ...this.options, readPreference: this.readPreference, session }, this.options.responseType ); return res; } } export class RunAdminCommandOperation<T = Document> extends AbstractOperation<T> { constructor( public command: Document, public override options: RunCommandOptions & { noResponse?: boolean; bypassPinningCheck?: boolean; } ) { super(options); this.ns = new MongoDBNamespace('admin', '$cmd'); } override get commandName() { return 'runCommand' as const; } override async execute(server: Server, session: ClientSession | undefined): Promise<T> { this.server = server; const res: TODO_NODE_3286 = await server.command(this.ns, this.command, { ...this.options, readPreference: this.readPreference, session }); return res; } }