import { GenericObject } from "@mongez/reinforcements"; import { CreateIndexesOptions } from "mongodb"; import { Database } from "../database"; export declare class Blueprint { protected readonly collectionName: string; protected readonly database: Database; /** * Blueprint Schema */ schema: GenericObject; /** * Constructor */ constructor(collectionName: string, database?: Database); /** * Create index */ index(columns: string | string[], options?: CreateIndexesOptions): Promise; /** * Create unique index */ unique(column: string | string[], options?: CreateIndexesOptions): Promise; /** * Create text index */ textIndex(column: string | string[], options?: CreateIndexesOptions): Promise; /** * Create geo index */ geoIndex(column: string | string[], options?: CreateIndexesOptions): Promise; /** * List indexes */ listIndexes(): Promise; /** * Drop index */ dropIndex(...columns: string[]): Promise; /** * Drop unique index */ dropUniqueIndex(...columns: string[]): Promise; /** * Drop text index */ dropTextIndex(...columns: string[]): Promise; /** * Drop geo index */ dropGeoIndex(...columns: string[]): Promise; /** * Drop all indexes */ dropAllIndexes(): Promise; /** * Check if index exists */ indexExists(name: string): Promise; /** * Get index name */ getIndexName(columns: string[], type?: string): string; /** * Get index info */ indexInformation(): Promise; /** * Get collection stats */ stats(withLatencyStats?: boolean): Promise; /** * Get collection size in bytes */ size(): Promise; /** * Get average document size in bytes */ averageDocumentSize(): Promise; /** * @alias averageDocumentSize */ avgDocSize(): Promise; /** * Get total indexes size in bytes */ indexesSize(): Promise; /** * Total size = collection size + indexes size */ totalSize(): Promise; /** * Count documents */ count(): Promise; /** * Delete all documents */ truncate(): Promise; /** * Drop collection */ drop(): Promise; /** * Get collection instance */ collection(): Collection; /** * Rename collection to the given name */ rename(newName: string): Promise; /** * Get base schema */ get baseSchema(): { _id: any; id: string; createdAt: DateConstructor; updatedAt: DateConstructor; }; /** * Get default schema */ baseSchemaWith(schema: GenericObject): { _id: any; id: string; createdAt: DateConstructor; updatedAt: DateConstructor; }; /** * Dump the entire collection */ dump(): Promise; } /** * Get a blueprint class for the given collection */ export declare function blueprint(collectionName: string): Blueprint; //# sourceMappingURL=blueprint.d.ts.map