Skip to content

Commit

Permalink
docs: add detailed "Supported Where Filters" table with examples and …
Browse files Browse the repository at this point in the history
…descriptions
  • Loading branch information
teles committed Dec 15, 2024
1 parent 10ab938 commit 798c9ee
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions docs/en/concepts/where-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

**Where filters** allow refining queries and retrieving specific subsets of data based on certain conditions. **HolySheets** supports a variety of filters, enabling precise data manipulation and retrieval.

## Supported Where Filters Table

| **Filter Type** | **Description** | **Example Usage** |
| --------------- | ------------------------------------------ | -------------------------------------------- |
| `equals` | Exact match | `{ status: { equals: 'active' } }` |
| `not` | Not equal | `{ role: { not: 'admin' } }` |
| `in` | Value is in a list of values | `{ status: { in: ['pending', 'shipped'] } }` |
| `notIn` | Value is not in a list of values | `{ category: { notIn: ['Electronics'] } }` |
| `lt` | Less than a specified value | `{ amount: { lt: 1000 } }` |
| `lte` | Less than or equal to a specified value | `{ attendees: { lte: 50 } }` |
| `gt` | Greater than a specified value | `{ experience: { gt: 5 } }` |
| `gte` | Greater than or equal to a specified value | `{ budget: { gte: 50000 } }` |
| `contains` | Contains a specified substring | `{ title: { contains: 'HolySheets' } }` |
| `startsWith` | Starts with a specified substring | `{ username: { startsWith: 'admin' } }` |
| `endsWith` | Ends with a specified substring | `{ email: { endsWith: '@example.com' } }` |
| `search` | Matches a regular expression pattern | `{ name: { search: '^Pro.*' } }` |

## equals

Filters records where the specified field exactly matches the provided value.
Expand Down Expand Up @@ -327,23 +344,6 @@ Retrieves all products whose `name` starts with `'Pro'` (e.g., `'Projector'`, `'
]
```

## Supported Where Filters Table

| **Filter Type** | **Description** | **Example Usage** |
| --------------- | ------------------------------------------ | -------------------------------------------- |
| `equals` | Exact match | `{ status: { equals: 'active' } }` |
| `not` | Not equal | `{ role: { not: 'admin' } }` |
| `in` | Value is in a list of values | `{ status: { in: ['pending', 'shipped'] } }` |
| `notIn` | Value is not in a list of values | `{ category: { notIn: ['Electronics'] } }` |
| `lt` | Less than a specified value | `{ amount: { lt: 1000 } }` |
| `lte` | Less than or equal to a specified value | `{ attendees: { lte: 50 } }` |
| `gt` | Greater than a specified value | `{ experience: { gt: 5 } }` |
| `gte` | Greater than or equal to a specified value | `{ budget: { gte: 50000 } }` |
| `contains` | Contains a specified substring | `{ title: { contains: 'HolySheets' } }` |
| `startsWith` | Starts with a specified substring | `{ username: { startsWith: 'admin' } }` |
| `endsWith` | Ends with a specified substring | `{ email: { endsWith: '@example.com' } }` |
| `search` | Matches a regular expression pattern | `{ name: { search: '^Pro.*' } }` |

## Best Practices

- **Consistent Headers:** Ensure that the first row of your spreadsheet contains clear and consistent headers. HolySheets relies on these headers to map the data correctly.
Expand Down

0 comments on commit 798c9ee

Please sign in to comment.