{% method %}

Where

To filter table's rows by any value you can use where clause. Each item of where clause should return boolean value.

Main format of where clause looks like bellow:

const query = {
  filter: {
    where: {
      operator: FDBOperators,
      args: Array<FDBWhere | FDBWhereArgs>
    } 
  } 
}

See types descriptions of FDB Operator, FDB Where and FDB Where Arguments for more details.

operator: string: one of listed values:

Logic Operators

OperatorDescription
&, and(a = 5) AND (b = 6)
|, or(a = 5 OR a = 6)
!, notIS NOT TRUE

Math Operators

OperatorDescription
== 3
!=, <>, ne!= 3
>, gt> 5
>=, gte>= 5
<, lt< 7
<=, lte<= 7

Other Operators

OperatorDescription
inIN [1, 2]
notInNOT IN [1, 2]
likeLIKE '%hat'
notLikeNOT LIKE '%hat'
iLikeILIKE '%hat' (case insensitive)
notILikeNOT ILIKE '%hat'
startsWithLIKE 'hat%'
endsWithLIKE '%hat'
substringLIKE '%hat%'
regexpREGEXP/~ '^[h | a | t]'
notRegexpNOT REGEXP/~ '^[h | a | t]'
iRegexp~* '^[h | a | t]'
notIRegexp!~* '^[h | a | t]'
betweenBETWEEN 6 AND 10
notBetweenNOT BETWEEN 11 AND 15
isIS NULL
overlap&& [1, 2] (PG array overlap operator)
contains@> [1, 2] (PG array contains operator)
contained<@ [1, 2] (PG array contained by operator)
anyANY ARRAY[2, 3]::INTEGER
all> ALL (SELECT 1)

args: Array<FDBWhere | FDBWhereArgs>:

{
  args: ['id', 3]
}

Where id is column name and 3 is value

{% sample lang="nodejs" -%}

const query = {
  filter: {
    where: {
      operator: '=',
      args: [ 'id', 2 ] // id = 2
    } 
  },
  context: {
    tableName: '245ce633-796f-4dfa-ae6f-4b2762adbf44'
  }
}

This query will be converted to SQL statement:

SELECT * FROM "245ce633-796f-4dfa-ae6f-4b2762adbf44" WHERE "id" = 2;

{% endmethod %}