Syntax

value.not() → result

Arguments

No arguments.

Optargs

No optional arguments.

Returns

result
boolean
Returns true if the value is false, and false if the value is true.

Behavior

  • Inverts the boolean value of the expression.
  • Converts truthy values to false and falsy values to true.
  • Commonly used to negate conditions in filters and logical expressions.
  • Can be chained with other logical operators for complex conditions.

Notes & Caveats

  • The not() function operates on boolean values or expressions that evaluate to boolean.
  • When used with non-boolean values, RuloDB’s truthiness rules apply.
  • Can be combined with other logical operators like and and or.

Example

Filter users who are not premium

Filter for users in the users table where the user is not a premium member.
await r
  .table('users')
  .filter((doc) => doc.field('isPremium').not())
  .run(client);

Filter orders that are not completed

Get orders that have not been completed yet.
await r
  .table('orders')
  .filter((doc) => doc.field('status').eq('completed').not())
  .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
  • or - Logical OR Operation
  • field - Referencing a Field
  • table - Referencing a Table
  • filter - Filtering Documents

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