UNPKG

adonis-odm

Version:

A comprehensive MongoDB ODM for AdonisJS with Lucid-style API, type-safe relationships, embedded documents, and transaction support

78 lines 2.04 kB
import { QueryOperator, QueryValue } from '../types/index.js'; /** * Where Conditions Builder * * Handles all where condition logic for the ModelQueryBuilder */ export declare class WhereConditionsBuilder { private filters; private orConditions; /** * Get the current filters */ getFilters(): any; /** * Get the current OR conditions */ getOrConditions(): any[]; /** * Set filters (used for cloning) */ setFilters(filters: any): void; /** * Set OR conditions (used for cloning) */ setOrConditions(orConditions: any[]): void; /** * Get the final MongoDB filter object */ getFinalFilters(): any; /** * Map query operator to MongoDB operator */ private mapOperatorToMongo; /** * Serialize value for MongoDB */ private serializeValue; /** * Add a where condition */ where(field: string, value: QueryValue): this; where(field: string, operator: QueryOperator, value: QueryValue): this; /** * Add a where not condition */ whereNot(field: string, value: QueryValue): this; whereNot(field: string, operator: QueryOperator, value: QueryValue): this; /** * Add an OR where condition */ orWhere(field: string, value: QueryValue): this; orWhere(field: string, operator: QueryOperator, value: QueryValue): this; /** * Where in condition */ whereIn(field: string, values: QueryValue[]): this; /** * Where not in condition */ whereNotIn(field: string, values: QueryValue[]): this; /** * Where between condition */ whereBetween(field: string, range: [QueryValue, QueryValue]): this; /** * Where null condition */ whereNull(field: string): this; /** * Where not null condition */ whereNotNull(field: string): this; /** * Clone the where conditions builder */ clone(): WhereConditionsBuilder; } //# sourceMappingURL=where_conditions.d.ts.map