import { GenericObject } from "@mongez/reinforcements"; import { LookupPipelineOptions, Pipeline, WhereOperator } from "../aggregate"; import { Model } from "../model"; export declare class Joinable { protected model: typeof Model; /** * Lookup data */ protected lookupData: LookupPipelineOptions; /** * Pipelines */ protected pipelines: (Pipeline | GenericObject)[]; /** * Constructor * The Joined Model */ constructor(model: typeof Model); /** * Set the local field */ localField(localField: string): this; /** * Get value from lookup data */ get(key: keyof LookupPipelineOptions, defaultValue?: any): any; /** * Set the foreign field */ foreignField(foreignField: string): this; /** * Set the as field */ as(as: string): this; /** * Wether to return a single document or an array */ single(single?: boolean): this; /** * Set the pipeline */ addPipelines(pipeline: (Pipeline | GenericObject)[]): this; /** * Add let */ let(letData: LookupPipelineOptions["let"]): this; /** * Add selected columns */ select(...columns: string[]): this; /** * Add pipeline */ addPipeline(pipeline: Pipeline | GenericObject): this; /** * Add a ware clause to the pipeline */ where(column: string, value: any): this; where(column: string, operator: WhereOperator, value: any): this; where(column: GenericObject): this; /** * Set all lookup data */ set(data: LookupPipelineOptions): this; /** * Parse the lookup data */ parse(): { from: string; localField?: string; foreignField?: string; as?: string; single?: boolean; pipeline?: (Pipeline | GenericObject)[]; let?: GenericObject; }; /** * Reset the pipelines */ reset(): void; /** * Clone the current instance */ clone(): Joinable; } //# sourceMappingURL=joinable.d.ts.map