# Using filters in Skyone Studio

To perform advanced queries in the **Skyone Studio** API, use the query parameter. The value of this parameter must be a valid JSON object sent in the *underline query* pattern.

### Base JSON Structure

Below is the complete structure that includes sorting, date range filtering, and pagination:

```json
{
  "sort": {
    "startTimeUTC": -1
  },
  "filter": {
    "startTimeUTC": {
      "_period_greater_equal": "2026-01-01T00:00:00Z",
      "_period_smaller_equal": "2026-01-06T23:59:59Z"
    }
  },
  "pagination": {
    "limit": 10,
    "skip": 0
  }
}
```

Read below for a better understanding of the items:

### Pagination

Controls the amount of data returned per request to optimize performance.

* **limit:** Defines the maximum number of items per page.
* **skip:** Defines how many items should be skipped (offset) to access the next pages.

Example:

```json
"pagination": {
  "limit":10
  "skip": 0
}

```

### Filter

The *filter* object allows you to refine your search using specific keys and comparison operators.

<table data-header-hidden><thead><tr><th width="145.78515625"></th><th width="193.35546875"></th><th></th></tr></thead><tbody><tr><td><strong>Operator</strong></td><td><strong>Description</strong></td><td><strong>Use Example</strong></td></tr><tr><td><code>_equal</code></td><td>Filters records where the column value exactly matches the specified value, respecting characters and case sensitivity (uppercase/lowercase).</td><td><code>"status": {"_equal": "active"}</code></td></tr><tr><td><code>_diff</code></td><td>Filters records where the column value does not match the specified value.</td><td><code>"id": {"_diff": 0}</code></td></tr><tr><td><code>_like</code></td><td>Filters records in which the column value contains the searched term, allowing for partial searches.</td><td><code>"name": {"_like": "Sky"}</code></td></tr><tr><td><code>_greater</code></td><td>Filters records where the column value is greater than the specified value.</td><td><code>"price": {"_greater": 50}</code></td></tr><tr><td><code>_smaller</code></td><td>Filters records where the value is less than the specified limit.</td><td><code>"stock": {"_smaller": 10}</code></td></tr><tr><td><code>_greater_equal</code></td><td>Filters records where the value is greater than or equal to the specified limit.</td><td><code>"age": {"_greater_equal": 18}</code></td></tr><tr><td><code>_smaller_equal</code></td><td>Filters records where the value is less than or equal to the specified limit.</td><td><code>"limit": {"_smaller_equal": 100}</code></td></tr><tr><td><code>_exists</code></td><td>Filters records based on the existence of the field/column in the document, returning those where the field is present (<code>true</code>) or absent (<code>false</code>), regardless of its value.</td><td><code>"tag": {"_exists": true}</code></td></tr><tr><td><code>_not_exists</code></td><td>Filters records where the field/column does not exist in the document, regardless of the value.</td><td><code>"deletedAt": {"_not_exists": true}</code></td></tr><tr><td><code>_in</code></td><td>Filters records where the column value is contained within a provided list (array) of values.</td><td><code>"role": {"_in": ["admin", "editor"]}</code></td></tr></tbody></table>

#### Date Range Filters (Date/Time)

For date fields such as ***startTimeUTC***, use the following period prefixes:

* **\_period\_greater:** Date after.
* **\_period\_smaller:** Date before.
* **\_period\_greater\_equal:** Start date (inclusive).
* **\_period\_smaller\_equal:** End date (inclusive).

In the scenario below, the filter acts as an && (and) operator:

```json
"startTimeUTC": {
      "_period_greater_equal": "2026-01-01T00:00:00Z",
      "_period_smaller_equal": "2026-01-06T23:59:59Z"
    }
```

### Sort

Defines the direction in which results are returned based on a key:

* -1: Descending Order (default).
* 1: Ascending Order.

\
Example:

```json
{
  "sort":{
    "startTimeUTC":-1
  }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.skyone.cloud/english/skyone-studio/how-to/using-filters-in-skyone-studio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
