Filters
Last updated
Last updated
Apply one or multiple filters for list endpoints like and . Each filter parameter refers to one field.
Filters can be submitted per URL with brackets or as URI Encoded JSON Object. Check out the to see how it's done.
GET
https://api.cmft.io/v1/<repoName>/<endpoint>?filters[0][*.<fields|meta>.<fieldName>][operator]=<value>
repoName
string
The API identifier of the repository
endpoint
string
The endpoint you'd like to request
filter
string
Provide a filter with square brackets or as URI Encoded JSON Object
Parameter Name
Description
filters
Notation
Apply a filter to multiple content types with a wildcard (*):
Or refer to a single document type using the following notation:
Or as JSON Object:
Filters for nested fields
When applying filters for fields nested in sections, you'll have to omit the section property key.
The path for the filter would be *.fields.myField
, instead of *.fields.mySection.myField
Decide if a document is included in a list by checking its tags.
Parameter Name
Description
includeTags
One of the tags must match for a document.
Notation
If a document has one of the stated tags, it will not be included in a response.
Parameter Name
Description
excludeTags
Document will not be included if it has one of the stated tags.
Notation
Use Relational Operators to evaluate a fields value. Here is a reference for the available operators:
Notation
Convention
Explanation
equal
equal
Validates true for a matching value
notEqual
not equal
Validates true for non-matching values
greaterThan
greater than
Validates true if the field value is greater than the specified value
greaterThanEqual
greater or equal to
Validates true if the field value is greater or equal to the specified value
lessThan
less than
Validates true if the field value is lower than the specified value
lessThanEqual
less or equal to
Validates true if the field value is lower or equal to the specified value
like
like
Validates true if a field value matches. Possible usage: startsWith%
, %endsWith
, %contains%
notLike
not like
Validates true if a field value does not match. Possible usage: startsWith%
, %endsWith
, %contains%
empty
empty
Validates true if the field value is empty
notEmpty
not empty
Validates true if the field value is not empty
in
in
Validates true if a value exists in an array
notIn
not in
Validates true if a value does not exists in an array
Use Logical Operators to connect filters. Available operators are:
AND
OR
Find some examples on the filters example page:
Filter which documents are returned in a query by checking the value with a .
For more examples, have a look at the .