Definition

Filter::field('options->languages', [FilterType::JSON_LENGTH]);

Array/Object Structure

target
string
required
operator
string,['=', '<', '<=', '>', '>=']
required
value
int
required

Example

$filter = [
    'type'     => '$jsonLength',
    'target'   => 'options->languages',
    'operator' => '>=',
    'value'    => 2,
];
$sql = User::filter([$filter])->toRawSql();

SQL

select * from "users"
where json_length("users"."options", '$."languages"') >= 2

Modifiers

None available.