⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/docs/00200-core-concepts/00300-tables/00300-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,27 @@ for (const user of ctx.db.user.age.filter(
<TabItem value="csharp" label="C#">

```csharp
// Find users aged 18 or older
foreach (var user in ctx.Db.User.Age.Filter(new Bound<byte>.Inclusive(18), null))
// Find users aged 18 to 65 (inclusive)
foreach (var user in ctx.Db.User.Age.Filter(new Bound<byte>(18, 65)))
{
Log.Info($"{user.Name} is {user.Age}");
}

// Find users aged 18 or older (inclusive, unbounded above)
foreach (var user in ctx.Db.User.Age.Filter(new Bound<byte>(18, byte.MaxValue)))
{
Log.Info($"{user.Name} is an adult");
}

// Find users younger than 18 (unbounded below, to 17 inclusive)
foreach (var user in ctx.Db.User.Age.Filter(new Bound<byte>(byte.MinValue, 17)))
{
Log.Info($"{user.Name} is a minor");
}
```

You can also use the implicit tuple conversion, like `ctx.Db.User.Age.Filter((18, byte.MaxValue))`, which is functionally identical.

</TabItem>
<TabItem value="rust" label="Rust">

Expand Down