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 GtBytes(field string, value []byte) Expr
- func GtFloat32(field string, value float32) Expr
- func GtFloat64(field string, value float64) Expr
- func GtInt(field string, value int) Expr
- func GtInt32(field string, value int32) Expr
- func GtInt64(field string, value int64) Expr
- func GtString(field string, value string) Expr
- func GtTime(field string, value time.Time) Expr
- func GtUUID(field string, value uuid.UUID) Expr
- func Gte(field string, value interface{}) Expr
- func GteBytes(field string, value []byte) Expr
- func GteFloat32(field string, value float32) Expr
- func GteFloat64(field string, value float64) Expr
- func GteInt(field string, value int) Expr
- func GteInt32(field string, value int32) Expr
- func GteInt64(field string, value int64) Expr
- func GteString(field string, value string) Expr
- func GteTime(field string, value time.Time) Expr
- func GteUUID(field string, value uuid.UUID) Expr
- func Lt(field string, value interface{}) Expr
- func LtBytes(field string, value []byte) Expr
- func LtFloat32(field string, value float32) Expr
- func LtFloat64(field string, value float64) Expr
- func LtInt(field string, value int) Expr
- func LtInt32(field string, value int32) Expr
- func LtInt64(field string, value int64) Expr
- func LtString(field string, value string) Expr
- func LtTime(field string, value time.Time) Expr
- func LtUUID(field string, value uuid.UUID) Expr
- func Lte(field string, value interface{}) Expr
- func LteBytes(field string, value []byte) Expr
- func LteFloat32(field string, value float32) Expr
- func LteFloat64(field string, value float64) Expr
- func LteInt(field string, value int) Expr
- func LteInt32(field string, value int32) Expr
- func LteInt64(field string, value int64) Expr
- func LteString(field string, value string) Expr
- func LteTime(field string, value time.Time) Expr
- func LteUUID(field string, value uuid.UUID) Expr
- func Or(ops ...Expr) Expr
- type Filter
- type Operand
Constants ¶
This section is empty.
Variables ¶
var All = Expr{}
All represents filter which includes all the documents of the collection.
Functions ¶
This section is empty.
Types ¶
type Expr ¶
type Expr map[string]interface{}
func And ¶
And composes 'and' operation. Result is equivalent to: (ops[0] && ... && ops[len(ops-1]).
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.
func GtBytes ¶
GtBytes composes 'equal' operation from []byte value. Result is equivalent to: field == value.
func GtFloat32 ¶
GtFloat32 composes 'equal' operation from float32 value. Result is equivalent to: field == value.
func GtFloat64 ¶
GtFloat64 composes 'equal' operation from float64 value. Result is equivalent to: field == value.
func GtInt ¶
GtInt composes 'equal' operation from int value. Result is equivalent to: field == value.
func GtInt32 ¶
GtInt32 composes 'equal' operation from int32 value. Result is equivalent to: field == value.
func GtInt64 ¶
GtInt64 composes 'equal' operation from int64 value. Result is equivalent to: field == value.
func GtString ¶
GtString composes 'equal' operation from string value. Result is equivalent to: field == value.
func GtTime ¶
GtTime composes 'equal' operation. from time.Time value. Result is equivalent to: field == value.
func GtUUID ¶
GtUUID composes 'equal' operation. from uuid.UUID value. Result is equivalent to: field == value.
func GteBytes ¶
GteBytes composes 'equal' operation from []byte value. Result is equivalent to: field == value.
func GteFloat32 ¶
GteFloat32 composes 'equal' operation from float32 value. Result is equivalent to: field == value.
func GteFloat64 ¶
GteFloat64 composes 'equal' operation from float64 value. Result is equivalent to: field == value.
func GteInt ¶
GteInt composes 'equal' operation from int value. Result is equivalent to: field == value.
func GteInt32 ¶
GteInt32 composes 'equal' operation from int32 value. Result is equivalent to: field == value.
func GteInt64 ¶
GteInt64 composes 'equal' operation from int64 value. Result is equivalent to: field == value.
func GteString ¶
GteString composes 'equal' operation from string value. Result is equivalent to: field == value.
func GteTime ¶
GteTime composes 'equal' operation. from time.Time value. Result is equivalent to: field == value.
func GteUUID ¶
GteUUID composes 'equal' operation. from uuid.UUID value. Result is equivalent to: field == value.
func LtBytes ¶
LtBytes composes 'equal' operation from []byte value. Result is equivalent to: field == value.
func LtFloat32 ¶
LtFloat32 composes 'equal' operation from float32 value. Result is equivalent to: field == value.
func LtFloat64 ¶
LtFloat64 composes 'equal' operation from float64 value. Result is equivalent to: field == value.
func LtInt ¶
LtInt composes 'equal' operation from int value. Result is equivalent to: field == value.
func LtInt32 ¶
LtInt32 composes 'equal' operation from int32 value. Result is equivalent to: field == value.
func LtInt64 ¶
LtInt64 composes 'equal' operation from int64 value. Result is equivalent to: field == value.
func LtString ¶
LtString composes 'equal' operation from string value. Result is equivalent to: field == value.
func LtTime ¶
LtTime composes 'equal' operation. from time.Time value. Result is equivalent to: field == value.
func LtUUID ¶
LtUUID composes 'equal' operation. from uuid.UUID value. Result is equivalent to: field == value.
func LteBytes ¶
LteBytes composes 'equal' operation from []byte value. Result is equivalent to: field == value.
func LteFloat32 ¶
LteFloat32 composes 'equal' operation from float32 value. Result is equivalent to: field == value.
func LteFloat64 ¶
LteFloat64 composes 'equal' operation from float64 value. Result is equivalent to: field == value.
func LteInt ¶
LteInt composes 'equal' operation from int value. Result is equivalent to: field == value.
func LteInt32 ¶
LteInt32 composes 'equal' operation from int32 value. Result is equivalent to: field == value.
func LteInt64 ¶
LteInt64 composes 'equal' operation from int64 value. Result is equivalent to: field == value.
func LteString ¶
LteString composes 'equal' operation from string value. Result is equivalent to: field == value.
func LteTime ¶
LteTime composes 'equal' operation. from time.Time value. Result is equivalent to: field == value.
func LteUUID ¶
LteUUID composes 'equal' operation. from uuid.UUID value. Result is equivalent to: field == value.