Definition

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

Array/Object Structure

target
string
required
value
string|int|float
required

Example

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

SQL

select * from "users"
where json_contains("users"."options", '\"en\"', '$."languages"')

Modifiers

None available.