Documentation
¶
Overview ¶
Package filter provides methods to build logical filters. Filters are used to read or update only documents, which satisfies the filter.
Index ¶
- Variables
- type Expr
- func And(ops ...Expr) Expr
- func Eq[T schema.PrimitiveFieldType](field string, value T) Expr
- func EqBytes(field string, value []byte) Expr
- func EqFloat32(field string, value float32) Expr
- func EqFloat64(field string, value float64) Expr
- func EqInt(field string, value int) Expr
- func EqInt32(field string, value int32) Expr
- func EqInt64(field string, value int64) Expr
- func EqString(field string, value string) Expr
- func EqTime(field string, value time.Time) Expr
- func EqUUID(field string, value uuid.UUID) Expr
- func Gt(field string, value interface{}) Expr
- func Gte(field string, value interface{}) Expr
- func Lt(field string, value interface{}) Expr
- func Lte(field string, value interface{}) Expr
- func Or(ops ...Expr) Expr
- type Filter
- type Operand
Constants ¶
This section is empty.
Variables ¶
var ( //All represents filter which includes all the documents of the collection All = driver.Filter(`{}`) )
Functions ¶
This section is empty.
Types ¶
type Expr ¶
type Expr map[string]interface{}
func Eq ¶
func Eq[T schema.PrimitiveFieldType](field string, value T) Expr
Eq composes 'equal' operation. Result is equivalent to: field == value
func EqBytes ¶
EqBytes composes 'equal' operation from []byte value. Result is equivalent to: field == value
func EqFloat32 ¶
EqFloat32 composes 'equal' operation from float32 value. Result is equivalent to: field == value
func EqFloat64 ¶
EqFloat64 composes 'equal' operation from float64 value. Result is equivalent to: field == value
func EqInt ¶
EqInt composes 'equal' operation from int value. Result is equivalent to: field == value
func EqInt32 ¶
EqInt32 composes 'equal' operation from int32 value. Result is equivalent to: field == value
func EqInt64 ¶
EqInt64 composes 'equal' operation from int64 value. Result is equivalent to: field == value
func EqString ¶
EqString composes 'equal' operation from string value. Result is equivalent to: field == value
func EqTime ¶
EqTime composes 'equal' operation. from time.Time value. Result is equivalent to: field == value
func EqUUID ¶
EqUUID composes 'equal' operation. from uuid.UUID value. Result is equivalent to: field == value