Syntax

value.or(otherValue) → result

Arguments

List of arguments to provide.
otherValue
boolean
required
The value to compare with.

Optargs

No optional arguments.

Returns

result
boolean
Returns true if either value is true and false otherwise.

Behavior

  • Performs logical OR operation on two boolean values.
  • Returns true when at least one of the values is true.
  • Can be chained with other logical operators for complex conditions.

Notes & Caveats

  • Both values are evaluated as booleans using RuloDB’s truthiness rules.
  • The operation is short-circuited: if the first value is true, the second is not evaluated.

Example

Filter for shipped or delivered orders

Filter for orders where the status is either shipped or delivered.
await r
  .table('orders')
  .filter((doc) => doc.status.eq('shipped').or(doc.status.eq('delivered')))
  .run(client);

Filter by multiple categories

Filter for products in either electronics or books categories.
await r
  .table('products')
  .filter((doc) => doc.category.eq('electronics').or(doc.category.eq('books')))
  .run(client);
  • eq - Logical Equality Operation
  • ne - Logical Inequality Operation
  • lt - Logical Less Than Operation
  • le - Logical Less Than or Equal Operation
  • gt - Logical Greater Than Operation
  • ge - Logical Greater Than or Equal Operation
  • and - Logical AND Operation
  • not - Logical NOT Operation
  • field - Referencing a Field
  • filter - Filtering Documents

Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!