# RecordIdRange

The RecordIdRange type targets a range of records within a table in the SurrealDB Kotlin SDK.

`RecordIdRange` targets a contiguous range of records within a table by their IDs. Pass it to the [CRUD builders](/docs/reference/kotlin/concepts/data-manipulation.md) to operate on a [range of records](/docs/reference/query-language/language-primitives/data-types/record-ids.md#record-ranges).

**Source:** [surrealdb.kotlin](https://github.com/surrealdb/surrealdb.kotlin)

```kotlin title="Import"
import com.surrealdb.kotlin.query.RecordIdRange
```

---

## Constructor

```kotlin title="Method Syntax"
RecordIdRange(table, start, end, includeEnd)
```

<table>
    <thead>
        <tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr>
    </thead>
    <tbody>
        <tr><td><code>table</code> _(required)_</td><td><code>String</code></td><td>-</td><td>The table name.</td></tr>
        <tr><td><code>start</code></td><td><code>String?</code></td><td><code>null</code></td><td>The inclusive start ID, or <code>null</code> for unbounded.</td></tr>
        <tr><td><code>end</code></td><td><code>String?</code></td><td><code>null</code></td><td>The end ID, or <code>null</code> for unbounded.</td></tr>
        <tr><td><code>includeEnd</code></td><td><code>Boolean</code></td><td><code>false</code></td><td>Whether the <code>end</code> ID is inclusive.</td></tr>
    </tbody>
</table>

```kotlin title="Example"
val range = RecordIdRange("person", start = "a", end = "m", includeEnd = true)

client.select(range).awaitAs<List<Person>>()
```

## Learn more

- [Value types](/docs/reference/kotlin/concepts/value-types.md)
- [`RecordId`](/docs/reference/kotlin/api/values/record-id.md) and [`Table`](/docs/reference/kotlin/api/values/table.md)
- [Record ranges](/docs/reference/query-language/language-primitives/data-types/record-ids.md#record-ranges) in SurrealQL
