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"
To perform more complex search requests different Comparison Types (or 'Query Operators') are supported.
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
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
Less than
curl 'http://127.0.0.1:1338/myDb/?price\[$lt\]=100'
PHP internal:
$testValue < $propertyValue
Less than or equal
curl 'http://127.0.0.1:1338/myDb/?price\[$lte\]=10.5'
PHP internal:
$testValue <= $propertyValue
Greater than
curl 'http://127.0.0.1:1338/myDb/?price\[$gt\]=10.5'
PHP internal:
$testValue > $propertyValue
Greater than or equal
curl 'http://127.0.0.1:1338/myDb/?price\[$gte\]=10.5'
PHP internal:
$testValue >= $propertyValue
Like
curl 'http://127.0.0.1:1338/myDb/?price\[$lk\]=10.5'
PHP internal:
Contains
E.g. tests if a string contains the given substring
curl 'http://127.0.0.1:1338/myDb/?type\[$con\]=tronic'
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'
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)
Empty
Perform a simple is false test
curl 'http://127.0.0.1:1338/myDb/?null_or_not_existing=$em'
PHP internal:
!$propertyValue
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"