prorm API Reference
    Preparing search index...

    Function exists

    • Helper to create EXISTS condition Returns records where the subquery returns at least one row

      Parameters

      • subquery: string | { $literal: string }

      Returns Record<string, any>

      // Find users with at least one order
      User.findAll({
      where: exists('SELECT 1 FROM orders WHERE orders.user_id = users.id')
      })