Search & filter

Perform a simple search by adding property key value pairs as query string to the request. This will generate a query with a single constraint (or 'condition') of type PropertyComparison.

curl "http://127.0.0.1:1338/myDb/?type=clothes"

Multiple key value pairs are combined using AND resulting in a LogicalComparison with nested constraints.

curl "http://127.0.0.1:1338/myDb/?type=clothes&price=19.5"

Comparison Types

To perform more complex search requests different Comparison Types (or 'Query Operators') are supported.

$eq

Equals

Perform strict comparison of property key and value with type checking

curl 'http://127.0.0.1:1338/myDb/?category\[$eq\]=merchandise'

PHP internal:

$testValue === $propertyValue

$ne

Not equals

Inverse strict comparison of property key and value with type checking

curl 'http://127.0.0.1:1338/myDb/?type\[$ne\]=electronics'

PHP internal:

$testValue !== $propertyValue

$lt

Less than

curl 'http://127.0.0.1:1338/myDb/?price\[$lt\]=100'

PHP internal:

$testValue < $propertyValue

$lte

Less than or equal

curl 'http://127.0.0.1:1338/myDb/?price\[$lte\]=10.5'

PHP internal:

$testValue <= $propertyValue

$gt

Greater than

curl 'http://127.0.0.1:1338/myDb/?price\[$gt\]=10.5'

PHP internal:

$testValue > $propertyValue

$gte

Greater than or equal

curl 'http://127.0.0.1:1338/myDb/?price\[$gte\]=10.5'

PHP internal:

$testValue >= $propertyValue

$lk

Like

curl 'http://127.0.0.1:1338/myDb/?price\[$lk\]=10.5'

PHP internal:

Source

$con

Contains

E.g. tests if a string contains the given substring

curl 'http://127.0.0.1:1338/myDb/?type\[$con\]=tronic'

Source

$in

In

E.g. tests if the property value is contained inside the given set of data

curl 'http://127.0.0.1:1338/myDb/?type\[$in\]\[\]=clothes&type\[$in\]\[\]=furniture'

Source

$null

Is null

Perform is_null which will also match not existing properties

curl 'http://127.0.0.1:1338/myDb/?null_or_not_existing=$null'

PHP internal:

is_null($propertyValue)

$em

Empty

Perform a simple is false test

curl 'http://127.0.0.1:1338/myDb/?null_or_not_existing=$em'

PHP internal:

!$propertyValue

Count

Add the keyword _count as last path segment before the query string

curl "http://127.0.0.1:1338/myDb/_count?type=clothes&price=19.5"