filter

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter *bson.M

Filter fields

func AND

func AND(filters ...Filter) Filter

AND matches if all of the filters match

func ArrayAll

func ArrayAll(field string, items []interface{}) Filter

ArrayAll matches if the field contains all of the specified items

func ArrayContains

func ArrayContains(field string, value interface{}) Filter

ArrayContains matches if the array in the field contains the specified value

func ArrayNotContains

func ArrayNotContains(field string, value interface{}) Filter

ArrayNotContains matches if the array in the field does not contain the specified value

func ArraySingleMatch

func ArraySingleMatch(field string, filters ...Filter) Filter

ArraySingleMatch matches if any of the items in the array match all filters

func ArraySize

func ArraySize(field string, size int) Filter

ArraySize matches if the array has the specified size

func BitsAll0

func BitsAll0(field string, mask int) Filter

BitsAll0 matches if all bits in a binary value (that are matched by the bitmask) are 0

func BitsAll1

func BitsAll1(field string, mask int) Filter

BitsAll1 matches if all bits in a binary value (that are matched by the bitmask) are 1

func BitsAny0

func BitsAny0(field string, mask int) Filter

BitsAny0 matches if any bit in a binary value (that is matched by the bitmask) is 0

func BitsAny1

func BitsAny1(field string, mask int) Filter

BitsAny1 matches if any bit in a binary value (that is matched by the bitmask) is 1

func Equal

func Equal(field string, value interface{}) Filter

Equal matches if field value is equal to the specified value

func Exists

func Exists(field string, exists bool) Filter

Exists matches if the field exists or not

func GreaterThan

func GreaterThan(field string, value interface{}) Filter

GreaterThan matches if field value is greater than the specified value

func GreaterThanOrEqual

func GreaterThanOrEqual(field string, value interface{}) Filter

GreaterThanOrEqual matches if field value is greater than or equal to the specified value

func IsType

func IsType(field string, typ types.Type) Filter

IsType matches if the field is of the specified type

func JavascriptExpression

func JavascriptExpression(expression string) Filter

JavascriptExpression matches if the field contains the specified text

func LessThan

func LessThan(field string, value interface{}) Filter

LessThan matches if field value is less than the specified value

func LessThanOrEqual

func LessThanOrEqual(field string, value interface{}) Filter

LessThanOrEqual matches if field value is less than or equal to the specified value

func Modulo

func Modulo(field string, divisor int, remainder int) Filter

Modulo matches if the remainder of devision on the fields value with the deviser equals the specified remainder

func NOR

func NOR(filters ...Filter) Filter

NOR matches if all filters are false

func NOT

func NOT(filter Filter) Filter

NOT matches if the filter does not match and doesn't match if the filter matches

func NotEqual

func NotEqual(field string, value interface{}) Filter

NotEqual matches if field value is not equal to the specified value

func OR

func OR(filters ...Filter) Filter

OR matches if any of the filters match

func Regex

func Regex(field string, regex string) Filter

Regex matches if the field value matches the regular expression

func TextSearch

func TextSearch(text string) Filter

TextSearch matches if the field contains the specified text

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL