Documentation ¶
Index ¶
- func NewFilter[T Operable](fields ...Field[T]) bson.M
- func NewFilterD[T Operable](fields ...Field[T]) bson.D
- type Field
- func And[T Operable](name string, values ...Field[T]) Field[logical]
- func AndBson(name string, values bson.D) Field[logical]
- func Eq(name string, val any) Field[comparator]
- func Gt(name string, val any) Field[comparator]
- func Gte(name string, val any) Field[comparator]
- func In(name string, val any) Field[comparator]
- func Lt(name string, val any) Field[comparator]
- func Lte(name string, val any) Field[comparator]
- func Neq(name string, val any) Field[comparator]
- func Nin(name string, val any) Field[comparator]
- func Nor[T Operable](name string, values ...Field[T]) Field[logical]
- func NorBson(name string, values bson.D) Field[logical]
- func Not[T Operable](name string, values ...Field[T]) Field[logical]
- func NotBson(name string, val bson.D) Field[logical]
- func Or[T Operable](name string, values ...Field[T]) Field[logical]
- func OrBson(name string, values ...bson.D) Field[logical]
- type Operable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Field ¶
type Field[T Operable] struct { // contains filtered or unexported fields }
Field is the base object type to generate the filters.
func AndBson ¶
AndBson create a new Field for a filter with the $and logical operator with a bson.D object
func NorBson ¶
NorBson create a new Field for a filter with the $nor logical operator with a bson.D object
func NotBson ¶
NotBson create a new Field for a filter with the $not logical operator with a bson.D object
func OrBson ¶
OrBson create a new Field for a filter with the $or logical operator with a bson.D object
func (Field[Operable]) FilterE ¶
FilterE converts the field to a bson.E object. #Warning this is not a valid filter and not to be used by itself. Use within a bson.D object.
Click to show internal directories.
Click to hide internal directories.