From f51334e06d761d6df6d34f2235786695c6edc177 Mon Sep 17 00:00:00 2001 From: rekhoff Date: Thu, 29 Jan 2026 13:41:27 -0800 Subject: [PATCH] Updated Query with Indexes to be code-accurate --- .../00300-tables/00300-indexes.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/docs/00200-core-concepts/00300-tables/00300-indexes.md b/docs/docs/00200-core-concepts/00300-tables/00300-indexes.md index 66d3c0fb692..e951e29ddec 100644 --- a/docs/docs/00200-core-concepts/00300-tables/00300-indexes.md +++ b/docs/docs/00200-core-concepts/00300-tables/00300-indexes.md @@ -349,13 +349,27 @@ for (const user of ctx.db.user.age.filter( ```csharp -// Find users aged 18 or older -foreach (var user in ctx.Db.User.Age.Filter(new Bound.Inclusive(18), null)) +// Find users aged 18 to 65 (inclusive) +foreach (var user in ctx.Db.User.Age.Filter(new Bound(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(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.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. +