Skip to content

RDoc-3828 + RDoc-3829 Conditional filtering#2476

Draft
Danielle9897 wants to merge 1 commit into
ravendb:mainfrom
Danielle9897:RDoc-3828-queryWithWhen
Draft

RDoc-3828 + RDoc-3829 Conditional filtering#2476
Danielle9897 wants to merge 1 commit into
ravendb:mainfrom
Danielle9897:RDoc-3828-queryWithWhen

Conversation

@Danielle9897
Copy link
Copy Markdown
Member

Issue link

https://issues.hibernatingrhinos.com/issue/RDoc-3828/Conditional-expression-support-the-new-when-method.
https://issues.hibernatingrhinos.com/issue/RDoc-3829/Document-in-and-all-in-in-when-conditions

Additional description

  • Added a new article: Conditional Filtering, documenting the new RQL when(condition, predicate) syntax.
  • @maciejaszyk pls note:
    I used predicate instead of filter in some places to avoid ambiguity:
    • The term “filtering” already describes the overall action of narrowing query results.
    • The term “filter” can be confused with RavenDB exploration-query filters.
    • predicate more precisely describes the second argument of when(condition, predicate)

Type of change

  • Content - docs
  • Content - cloud
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

@Danielle9897 Danielle9897 requested a review from maciejaszyk June 1, 2026 15:46
Comment on lines +234 to +235
* Comparisons in the condition are **strictly typed**. Comparing incompatible types
(for example, a string parameter against a number, or a boolean against a string) throws a `RavenException`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not true. You can mix types when it makes sense. For example, when a parameter is a string and a constant is a number, we know how to convert the number into a string. You can think of it like working with an index. When we index a number, we actually index three values: String ("10"), Long (10L), and Double (10D).

Image

@Danielle9897 Danielle9897 marked this pull request as draft June 3, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants