docs: improve database operations docs + added data model repository reference (#12273)

* some changes

* docs: improve database operations docs + add data model repository reference

* regenerate
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-04-23 19:22:50 +03:00
1 parent 876a14eb98
commit 54bae210b8
21 files changed
+20651 -17089

No files matched your search

@@ -2,6 +2,8 @@
sidebar_label: "Filtering"
---
import { Table } from "docs-ui"
export const metadata = {
title: `Filter Records - Service Factory Reference`,
}
@@ -273,4 +275,181 @@ In the example above, posts are retrieved if they meet either of the following c
1. The post has at least `50` views and was published after the beginning of the current year.
2. The post's title contains the word `Featured`.
By combining `and` and `or` conditions, you can create complex filters to retrieve records that meet specific criteria.
By combining `and` and `or` conditions, you can create complex filters to retrieve records that meet specific criteria.
---
## Supported Filter Operators List
The following operators are supported by the service factory filtering mechanism:
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Operator
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row className="bg-medusa-bg-component">
<Table.Cell colSpan={2}>
Comparison Operators
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$eq`
</Table.Cell>
<Table.Cell>
Matches values that are equal to a specified value.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$ne`
</Table.Cell>
<Table.Cell>
Matches values that are not equal to a specified value.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$in`
</Table.Cell>
<Table.Cell>
Matches any of the values specified in an array.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$nin`
</Table.Cell>
<Table.Cell>
Matches none of the values specified in an array.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$like`
</Table.Cell>
<Table.Cell>
Matches values containing a specified substring.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$lt`
</Table.Cell>
<Table.Cell>
Matches values that are less than a specified value.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$lte`
</Table.Cell>
<Table.Cell>
Matches values that are less than or equal to a specified value.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$gt`
</Table.Cell>
<Table.Cell>
Matches values that are greater than a specified value.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$gte`
</Table.Cell>
<Table.Cell>
Matches values that are greater than or equal to a specified value.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$re`
</Table.Cell>
<Table.Cell>
Matches values that match a specified regular expression.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$ilike`
</Table.Cell>
<Table.Cell>
Matches values containing a specified substring, case-insensitive.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$fulltext`
</Table.Cell>
<Table.Cell>
Performs a full-text search on a text property.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$overlap`
</Table.Cell>
<Table.Cell>
Matches values that have overlapping elements with the specified array.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$contains`
</Table.Cell>
<Table.Cell>
Performs an `@> value` comparison. Learn more in the [PostgreSQL documentation](https://www.postgresql.org/docs/9.6/functions-array.html).
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$contained`
</Table.Cell>
<Table.Cell>
Performs an `value @>` comparison. Learn more in the [PostgreSQL documentation](https://www.postgresql.org/docs/9.6/functions-array.html).
</Table.Cell>
</Table.Row>
<Table.Row className="bg-medusa-bg-component">
<Table.Cell colSpan={2}>
Logical Operators
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$and`
</Table.Cell>
<Table.Cell>
Joins two or more conditions with a logical AND.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$or`
</Table.Cell>
<Table.Cell>
Joins two or more conditions with a logical OR.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`$not`
</Table.Cell>
<Table.Cell>
Inverts the logic of a condition. For example, `$not: { $eq: value }` matches any value that is not equal to the specified value.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>