Filters syntax
In order to find records by specified criteria, use filters. This section describes how specify filtering constraints.

Constructing criteria
Available operators
Examples
Constructing criteria
Filters are an array passed as as URL-encoded to the filters query-string parameter.

This array requires ['field_name'=>['<condition>'=>'value'] array syntax.

If desired field is inside a nested array, use . (dot) as following keys separator, eg. translations.en_US.field.

If no condition is specified, a platform assumes you want to test value against ==.

[
    'field'=>'scalar value'
]
This is equal to:

[
    'field'=>['='=>'scalar value']
]
It's possible to specify a few conditions in single request:

[
    'field'=>'value',
    'another_field'=>'another value'
]
Values above will be joined using AND operator.

If you need to construct more complex criteria, eg. range of values, create a nested array:

[
    'field'=>[
        '>'=>10,
        '<'=>20
    ]
]
Available operators
Operators are case-insensitive.

operator	example	description
=
['field'=>['='=>'value']
equal operator - returns records with field value specified exact
!=
['field'=>['!='=>'value']
different operator - returns records with field is different than specified
>
['field'=>['>'=>0]
greater than - returns records with field is larger than specified value
>=
['field'=>['>='=>1]
greater than or equal - returns records with field is larger or equals specified value
<
['field'=>['<'=>11]
smaller than - returns records with field is smaller than specified value
<=
['field'=>['<='=>10]
smaller than or equal - returns records with field is smaller or equals specified value
LIKE
~
['field'=>['LIKE'=>'value%']
['field'=>['~'=>'value%']
returns records with field is starting, ending or containing specified value; % specifies "wildcard" part of value should be tested against
NOT LIKE
!~
['field'=>['NOT LIKE'=>'value%']
['field'=>['!~'=>'value%']
returns records with field is NOT starting, neither ending nor containing specified value; % specifies "wildcard" part of value should be tested against
IN
['field'=>['IN'=>[1,2,3,4]]
returns records which field value is in specified array
NOT IN
['field'=>['NOT IN'=>[5,6,7,8]]
returns records which field value is NOT in specified array
Examples
Find all enabled products with name starting from z letterPHP
$res = new \DreamCommerce\Resource\Product($client);
$res->filters([
    'translations.en_US.active'=>true,
    'translations.en_US.name'=>['~'=>'z%']
]);
$data = $res->get();
Find all taxes with value higher than 20%PHP
$res = new \DreamCommerce\Resource\Tax($client);
$res->filters([
    'value'=>['>'=>20]
]);
$data = $res->get();
Find all images for products with ID [1,2,3,4]PHP
$res = new \DreamCommerce\Resource\ProductImage($client);
$res->filters([
    'product_id'=>[
        'IN'=>[1,2,3,4]
    ]
]);
$data = $res->get();