Documentation ¶
Overview ¶
Package boolean Boolean expressions evaluate their argument expressions as booleans and return a boolean as the result. In addition to the false boolean value, Boolean expression evaluates as false the following: null, 0, and undefined values. The Boolean expression evaluates all other values as true, including non-zero numeric values and arrays.
Index ¶
- Variables
- func And[T expression.AnyExpression](filters ...T) booleanOperator
- func NewAddFilter[T expression.AnyExpression](filters []T) addFilter[T]
- func NewNotFilter[T expression.AnyExpression](value T) notFilter[T]
- func NewOrNorFilter[T expression.AnyExpression](operator Operator, filters []T) orNorFilter[T]
- func Nor[T expression.AnyExpression](filters ...T) booleanOperator
- func Not[T expression.AnyExpression](f T) booleanOperator
- func Or[T expression.AnyExpression](filters ...T) booleanOperator
- type Operator
Constants ¶
This section is empty.
Variables ¶
var ( OR = NewOperator("$or", "Or") NOR = NewOperator("$nor", "Nor") )
var ( DBREFKeys = []string{ "$ref", "$id", } DBREFKeysWithDb = []string{ "$ref", "$id", "$db", } )
Functions ¶
func And ¶
func And[T expression.AnyExpression](filters ...T) booleanOperator
And Evaluates one or more expressions and returns true if all of the expressions are true or if run with no argument expressions. Otherwise, $and returns false.
func NewAddFilter ¶
func NewAddFilter[T expression.AnyExpression](filters []T) addFilter[T]
func NewNotFilter ¶
func NewNotFilter[T expression.AnyExpression](value T) notFilter[T]
func NewOrNorFilter ¶
func NewOrNorFilter[T expression.AnyExpression](operator Operator, filters []T) orNorFilter[T]
func Nor ¶
func Nor[T expression.AnyExpression](filters ...T) booleanOperator
Nor Evaluates one or more expressions and returns true if any of the expressions are true. Otherwise, $or returns false. $or has the following syntax: { $or: [ <expression1>, <expression2>, ... ] }
func Not ¶
func Not[T expression.AnyExpression](f T) booleanOperator
Not Evaluates a boolean and returns the opposite boolean value; i.e. when passed an expression that evaluates to true, $not returns false; when passed an expression that evaluates to false, $not returns true. $not has the following syntax: { $not: [ <expression> ] }
func Or ¶
func Or[T expression.AnyExpression](filters ...T) booleanOperator
Or Evaluates one or more expressions and returns true if any of the expressions are true. Otherwise, $or returns false. $or has the following syntax: { $or: [ <expression1>, <expression2>, ... ] }