Boolean Operators

Created by Brian Glick, Modified on Wed, 5 Nov at 5:26 AM by Brian Glick

and (Boolean AND)

The 'and' operator returns Boolean true if both operands evaluate to true.  If either or both operands are not a Boolean type, then they are first cast to a Boolean using the rules of the $boolean function.

Example

library.books["Aho" in authors and price < 50].title

or (Boolean OR)

The 'or' operator returns Boolean true if either operand evaluates to true.  If either or both operands are not a Boolean type, then they are first cast to a Boolean using the rules of the $boolean function.

Example

library.books[price < 10 or section="diy"].title

Please note that Boolean 'NOT' is a function, not an operator.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article