Vex · Query DSL

Comparison operators

The filter operators that test one column against a value, a list or NULL: eq, neq, gt, gte, lt, lte, in, notIn, like, ilike, isNull and isNotNull, each with the SQL condition compileFilter returns for it. There is no between: write a gte and an lte together.

Filters
[
  { eq: ['bookings.seats', 2] },
  { neq: ['bookings.seats', 2] },
  { gt: ['bookings.seats', 2] },
  { gte: ['bookings.seats', 2] },
  { lt: ['bookings.seats', 2] },
  { lte: ['bookings.seats', 2] },
  { in: ['bookings.seats', [1, 2]] },
  { notIn: ['bookings.seats', [1, 2]] },
  { like: ['bookings.id', 'B-204%'] },
  { ilike: ['bookings.id', 'b-204%'] },
  { isNull: 'bookings.member_id' },
  { isNotNull: 'bookings.member_id' },
]
SQL, one line per filter
b1.seats = 2
b1.seats <> 2
b1.seats > 2
b1.seats >= 2
b1.seats < 2
b1.seats <= 2
b1.seats IN (1, 2)
b1.seats NOT IN (1, 2)
b1.id LIKE 'B-204%'
b1.id ILIKE 'b-204%'
b1.member_id IS NULL
b1.member_id IS NOT NULL
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.