prorm API Reference
    Preparing search index...

    Function where

    • Helper to create where conditions Supports multiple call signatures:

      • where({ status: 'active', age: { $gte: 18 } }) - create WHERE from object
      • where('age', Op.gte, 18) - create WHERE with operator
      • where({ OR: [...] }) or where({ AND: [...] }) - nested conditions

      Parameters

      • condition: WhereConditionObject

      Returns WhereConditionObject

      // Object form - simple conditions
      where({ status: 'active' })
      // => { status: 'active' }

      // Object form - with operators
      where({ age: { $gte: 18 }, status: 'active' })
      // => { age: { $gte: 18 }, status: 'active' }

      // Three-argument form
      where('age', Op.gte, 18)
      // => { age: { $gte: 18 } }

      // Nested OR
      where({ OR: [{ status: 'active' }, { role: 'admin' }] })
      // => { $or: [{ status: 'active' }, { role: 'admin' }] }

      // Nested AND
      where({ AND: [{ age: { $gte: 18 } }, { status: 'active' }] })
      // => { $and: [{ age: { $gte: 18 } }, { status: 'active' }] }
    • Helper to create where conditions Supports multiple call signatures:

      • where({ status: 'active', age: { $gte: 18 } }) - create WHERE from object
      • where('age', Op.gte, 18) - create WHERE with operator
      • where({ OR: [...] }) or where({ AND: [...] }) - nested conditions

      Parameters

      Returns Record<string, any>

      // Object form - simple conditions
      where({ status: 'active' })
      // => { status: 'active' }

      // Object form - with operators
      where({ age: { $gte: 18 }, status: 'active' })
      // => { age: { $gte: 18 }, status: 'active' }

      // Three-argument form
      where('age', Op.gte, 18)
      // => { age: { $gte: 18 } }

      // Nested OR
      where({ OR: [{ status: 'active' }, { role: 'admin' }] })
      // => { $or: [{ status: 'active' }, { role: 'admin' }] }

      // Nested AND
      where({ AND: [{ age: { $gte: 18 } }, { status: 'active' }] })
      // => { $and: [{ age: { $gte: 18 } }, { status: 'active' }] }