mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 01:15:03 +03:00
Adds a not about the order of filters
This commit is contained in:
1 parent
e4c1442276
commit
0f17c47692
1 file changed
+28
@@ -1162,6 +1162,34 @@ pages:
|
||||
Filters can be used on `select()`, `update()`, and `delete()` queries.
|
||||
|
||||
If a Stored Procedure returns a table response, you can also apply filters.
|
||||
|
||||
### Applying Filters
|
||||
|
||||
You must apply your filters to the end of your query. For example:
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.eq('name', 'The Shire') // Correct
|
||||
|
||||
const { data, error } = await supabase
|
||||
.from('cities')
|
||||
.eq('name', 'The Shire') // Incorrect
|
||||
.select('name, country_id')
|
||||
```
|
||||
|
||||
### Chaining
|
||||
|
||||
Filters can be chained together to produce advanced queries. For example:
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.gte('population', 1000)
|
||||
.lt('population', 10000)
|
||||
```
|
||||
|
||||
.filter():
|
||||
$ref: '@supabase/postgrest-js."lib/PostgrestFilterBuilder".PostgrestFilterBuilder.filter'
|
||||
|
||||
Reference in new issue
Block a user