Advanced Filtering
POST: /api/v1/{spaceName}/filter/{typeModel}/{model}
This endpoint is used for advanced filtering of collections or pages.
Query Parameters
| Name | Example | Possible values | Description |
|---|---|---|---|
| page | 1 | 1,2,3,4... | The page number to retrieve. The number of objects returned is specified in the pagination settings in the request body. |
| search | Book title | - | Text string for searching objects by the name field. |
Request Body
Pagination
{
"pagination": {
"limit": 20,
"offset": 1
}
}The pagination object specifies the page size returned in the response.
Filter
{
"filter": {
"$and": [
{
"name": {
"$regex": "Barry",
"$options": "i"
}
},
{
"price": {
"$lt": 500
}
}
]
}
}The filter object uses MongoDB query format. It's highly flexible and allows you to request data with any filtering criteria. All collection page filters utilize this format.
See Filter Operators for details.
Sort
{
"sort": {
"name": 1,
"price": -1
}
}Sort order is specified using 1 for ascending and -1 for descending, based on MongoDB sorting functionality.
Fields
{
"fields": {
"name": 1,
"sku": 1
}
}If the fields parameter is set, only the fields specified in the object with a value of 1 will be returned. Internally, this object is set in the aggregation pipeline as $project.