---
title: Filters
slug: filters
docTags: 
createdAt: 2024-09-23T11:38:44.603Z
---

## Filtering data in a request

You can apply filters to any field depending on type.

Chose any field from [Table Schema](https://docs.dton.io/transactions-and-account-states)


Syntax:

`field__filter`

Example:

:::GraphiQL
```json
{
  "endpoint": "https://dton.io/graphql/",
  "query": "{\nraw_transactions(parsed_dns_domain__contains: \"dton\"){\n    address\n    workchain\n    parsed_dns_domain\n  }\n}"
}
```
:::

## Available filters:

- `exact` - Exact match (this is default one when you use seqno: 1 e.g.)
- `contains` - Case-sensitive containment test
- `in` - In a given list
- `gt` - Greater than
- `gte` - Greater than or equal to
- `lt` - Less than
- `lte` - Less than or equal to
- `range` - In a given range \[val\_from, val\_to], both included
- `isnull` - Takes either True or False, which correspond to SQL queries of IS NULL and IS NOT NULL, respectively
- `friendly` - Filter by user-friendly form of address. Accepts bounceable, non-bounceable and raw form (workchain\:address)
- `friendly_in` - Filter on a list of addresses in user-friendly form. Accepts bounceable, non-bounceable and raw form (workchain\:address)

## AND / OR / NOT

&#x20;1\. `and__`: This filter is used to apply a logical AND to multiple conditions. (default one when you use several keys:&#x20;
`{workchain: -1, seqno: 1}` = `workchain = 1 AND seqno = 1`&#x20;

:::GraphiQL
```json
{
  "endpoint": "https://dton.io/graphql/",
  "query": "{\n  raw_transactions(\n    and__: [{workcain: -1, seqno: 1}, {seqno: 2}]\n  ) {\n    seqno\n    workchain\n  }\n}"
}
```
:::

2\. `or__:` This filter is used to apply a logical OR to multiple conditions.

:::GraphiQL
```json
{
  "endpoint": "https://dton.io/graphql/",
  "query": "{\n  raw_transactions(\n    or__: [{seqno: 1}, {seqno: 2}]\n  ) {\n    seqno\n    shard\n  }\n}"
}
```
:::

3\. `not__`: This filter is used to negate a condition.

:::GraphiQL
```json
{
  "endpoint": "https://dton.io/graphql/",
  "query": "{\n  raw_transactions(\n    not__: {seqno: 1}\n  ) {\n    seqno\n    shard\n  }\n}"
}
```
:::

4\. Nested Filters (max depth: 3)

:::GraphiQL
```json
{
  "endpoint": "https://dton.io/graphql/",
  "query": "{\n  raw_transactions(or__: [\n      {seqno: 0}, \n      {seqno: 1}, \n      {seqno: 2}, \n      {and__: {seqno__gt: 10, seqno__lte: 15}}]) {\n    seqno\n  }\n}"
}
```
:::

