@d34d/w-orm - v0.6.0
    Preparing search index...

    Function Between

    • A filter that checks if a value is between two values.

      Type Parameters

      • T

        The type of the value to filter

      Parameters

      • lower: T | null

        The lower bound of the filter

      • upper: T | null

        The upper bound of the filter

      • lowerOpen: boolean = false

        Whether the lower bound is open

      • upperOpen: boolean = false

        Whether the upper bound is open

      Returns BetweenFilter<T>

      // Get all users with an age between 20 and 30
      const query = User.filter({ age: BetweenFilter(20, 30) })
      // Get all users with an age between 20 and 30, excluding 20 and 30
      const query = User.filter({ age: BetweenFilter(20, 30, true, true) })
      // It is also used for custom indexes
      const query = User.withIndex('age', Between(10, 10))