Spaces:
Runtime error
Runtime error
Download static/node_modules/mongodb/src/operations/stats.ts from kaab4321/NarrativeFlow: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongodb/src/operations/stats.ts
- Command line
-
hf download hf://spaces/kaab4321/NarrativeFlow/static/node_modules/mongodb/src/operations/stats.ts
-
curl -L -o stats.ts https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongodb/src/operations/stats.ts
1.11 kB
| import type { Document } from '../bson'; | |
| import type { Db } from '../db'; | |
| import type { Server } from '../sdam/server'; | |
| import type { ClientSession } from '../sessions'; | |
| import { CommandOperation, type CommandOperationOptions } from './command'; | |
| import { Aspect, defineAspects } from './operation'; | |
| /** @public */ | |
| export interface DbStatsOptions extends CommandOperationOptions { | |
| /** Divide the returned sizes by scale value. */ | |
| scale?: number; | |
| } | |
| /** @internal */ | |
| export class DbStatsOperation extends CommandOperation<Document> { | |
| override options: DbStatsOptions; | |
| constructor(db: Db, options: DbStatsOptions) { | |
| super(db, options); | |
| this.options = options; | |
| } | |
| override get commandName() { | |
| return 'dbStats' as const; | |
| } | |
| override async execute(server: Server, session: ClientSession | undefined): Promise<Document> { | |
| const command: Document = { dbStats: true }; | |
| if (this.options.scale != null) { | |
| command.scale = this.options.scale; | |
| } | |
| return await super.executeCommand(server, session, command); | |
| } | |
| } | |
| defineAspects(DbStatsOperation, [Aspect.READ_OPERATION]); | |