Documentation ¶
Index ¶
- func CommonBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, ...) (bson.D, error)
- func EqualBSONFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, ...) (results bson.D, err error)
- func ExistsBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, ...) (bson.D, error)
- func InBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, ...) (bson.D, error)
- func IsNullBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, ...) (bson.D, error)
- func StringBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, ...) (bson.D, error)
- type BSONizer
- type BSONizerFunc
- type Operator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonBSONizerFunc ¶
func CommonBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, fv *query.OperatorValues) (bson.D, error)
CommonBSONizerFunc is the BSONizerFunc used for multiple filter operators.
func EqualBSONFunc ¶
func EqualBSONFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, fv *query.OperatorValues) (results bson.D, err error)
EqualBSONFunc is the func that gets the filter bson.E for given scope and filter values.
func ExistsBSONizerFunc ¶
func ExistsBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, fv *query.OperatorValues) (bson.D, error)
ExistsBSONizerFunc is the BSONizerFunc that checks if the given field exists in the given collection.
func InBSONizerFunc ¶
func InBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, fv *query.OperatorValues) (bson.D, error)
InBSONizerFunc is the BSONizerFunc that handles $in and $notin operators.
func IsNullBSONizerFunc ¶
func IsNullBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, fv *query.OperatorValues) (bson.D, error)
IsNullBSONizerFunc is the BSONizerFunc for the $isnull and $notnull operators.
func StringBSONizerFunc ¶
func StringBSONizerFunc(b *BSONizer, s *query.Scope, field *mapping.StructField, fv *query.OperatorValues) (bson.D, error)
StringBSONizerFunc is the BSONizerFunc that handles string related filters operators.
Types ¶
type BSONizer ¶
type BSONizer struct {
// contains filtered or unexported fields
}
BSONizer is the struct that creates and parses the bson.D for the given scope's query.
func NewBSONizer ¶
NewBSONizer creates new BSONizer with the provided operators.
func (*BSONizer) ParseFilters ¶
ParseFilters parses the query filters into bson.D format.
func (*BSONizer) RegisterOperator ¶
RegisterOperator registers the BSONizer Operator
type BSONizerFunc ¶
type BSONizerFunc func(*BSONizer, *query.Scope, *mapping.StructField, *query.OperatorValues) (bson.D, error)
BSONizerFunc is the function that parses the scope's filter into bson.D struct.
type Operator ¶
type Operator struct { O *query.Operator Func BSONizerFunc Raw string }
Operator is the query.Operator wrapper that contains BSONizerFunc and a raw mongo string value.
func NewOperator ¶
func NewOperator(o *query.Operator, bFunc BSONizerFunc, raw ...string) Operator
NewOperator creates new filters operator.