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. +