Files
supabase/apps/temp-docs/docs/reference/javascript/range.mdx
2022-04-26 14:17:19 +02:00

162 lines
2.9 KiB
Plaintext

---
id: range
title: "range()"
slug: range
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Limits the result to rows within the specified range, inclusive.
<Tabs
defaultActiveId="js"
groupId="reference/supabase-js"
values={[{ label: 'JavaScript', value: 'js' }]}>
<TabsPanel id="js" label="js">
```js
const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.range(0,3)
```
</TabsPanel>
</Tabs>
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
from
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>number</code>
</span>
</h4>
<div class="method-list-item-description">
The starting index from which to limit the result, inclusive.
</div>
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
to
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>number</code>
</span>
</h4>
<div class="method-list-item-description">
The last index to which to limit the result, inclusive.
</div>
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
__namedParameters
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>object</code>
</span>
</h4>
<div class="method-list-item-description">
No description provided.
</div>
<ul className="method-list-group">
<h5 class="method-list-title method-list-title-isChild expanded">Properties</h5>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
foreignTable
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>undefined</code> | <code>string</code>
</span>
</h4>
<div class="method-list-item-description">
The foreign table to use (for foreign columns).
</div>
</li>
</ul>
</li>
</ul>
## Examples
### With `select()`
<Tabs
defaultActiveId="js"
groupId="reference/supabase-js"
values={[{ label: 'JavaScript', value: 'js' }]}>
<TabsPanel id="js" label="js">
```js
const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.range(0,3)
```
</TabsPanel>
</Tabs>