import { Entity, ValueObject } from "@rtcts/isomorphic"; import { ObjectId } from "bson"; import { Collection, CollectionCreateOptions, CollectionInsertManyOptions, CollectionInsertOneOptions, CommonOptions, FilterQuery, FindOneAndDeleteOption, FindOneOptions, ReplaceOneOptions, UpdateQuery } from "mongodb"; import { MongoDBConnection } from "./MongoDBConnection"; declare type QueryData = { _id: string | ObjectId; } & { [key: string]: any; }; export declare class MongoDBRepository { private readonly name; private readonly db; private readonly options?; private collection?; protected readonly Entity: new (data: any) => ENTITY; constructor(name: string, db: MongoDBConnection, Entity: new (data: any) => ENTITY, options?: CollectionCreateOptions); getCollection(): Promise | null>; onValidation(): Promise; offValidation(): Promise; insertMany(items: ValueObject[], options?: CollectionInsertManyOptions): Promise; insertOne(item: ValueObject, options?: CollectionInsertOneOptions): Promise; find(query: FilterQuery, offset?: number, limit?: number, options?: FindOneOptions): Promise; findOne(query: FilterQuery, options?: FindOneOptions): Promise; findById(id: string, options?: FindOneOptions): Promise; findOneAndUpdate(entity: ENTITY): Promise; findOneAndRemove(query: FilterQuery, options?: FindOneAndDeleteOption): Promise; findByIdAndRemove(id: string, options?: FindOneAndDeleteOption): Promise; updateOne(query: FilterQuery, update: UpdateQuery, options?: ReplaceOneOptions): Promise; updateMany(query: FilterQuery, update: UpdateQuery, options?: ReplaceOneOptions): Promise; deleteOne(query: FilterQuery, options?: CommonOptions): Promise; deleteMany(query: FilterQuery, options?: CommonOptions): Promise; private normalizeObjectID; private createEntity; private removeID; protected getOptions(options?: object): object | undefined; } export {};