Documentation ¶
Index ¶
- Constants
- Variables
- type DataType
- type Filter
- func All[T any](key string, items []T) *Filter
- func And(others ...*Filter) *Filter
- func BitsAllClear(key string, mask int) *Filter
- func BitsAllClearByBinary(key string, bin primitive.Binary) *Filter
- func BitsAllClearByPositions(key string, pos []int) *Filter
- func BitsAllSet(key string, mask int) *Filter
- func BitsAllSetByBinary(key string, bin primitive.Binary) *Filter
- func BitsAllSetByPositions(key string, pos []int) *Filter
- func BitsAnyClear(key string, mask int) *Filter
- func BitsAnyClearByBinary(key string, bin primitive.Binary) *Filter
- func BitsAnyClearByPositions(key string, pos []int) *Filter
- func BitsAnySet(key string, mask int) *Filter
- func BitsAnySetByBinary(key string, bin primitive.Binary) *Filter
- func BitsAnySetByPositions(key string, pos []int) *Filter
- func Cast(d rawbson.D) *Filter
- func ElemMatch(key string, sub *Filter) *Filter
- func ElemMatchWithInterval(key string, interval *Interval) *Filter
- func Eq(key string, val any) *Filter
- func Exists(key string, val bool) *Filter
- func Expr(expression any) *Filter
- func From(m rawbson.M) *Filter
- func Gt(key string, val any) *Filter
- func Gte(key string, val any) *Filter
- func In[T any](key string, items []T) *Filter
- func Like(key string, matcher *Matcher) *Filter
- func Lt(key string, val any) *Filter
- func Lte(key string, val any) *Filter
- func Mod(key string, divisor, remainder float64) *Filter
- func Ne(key string, val any) *Filter
- func New() *Filter
- func Nin[T any](key string, items []T) *Filter
- func Nor(others ...*Filter) *Filter
- func Not(key string, sub *Filter) *Filter
- func Or(others ...*Filter) *Filter
- func Size(key string, size int64) *Filter
- func Text(search *text.Search) *Filter
- func Type(key string, val *DataType) *Filter
- func Where(key, expression string) *Filter
- func WithInterval(key string, val *Interval) *Filter
- func (f *Filter) All(key string, items []any) *Filter
- func (f *Filter) And(others ...*Filter) *Filter
- func (f *Filter) Append(other *Filter) *Filter
- func (f *Filter) BitsAllClear(key string, mask int) *Filter
- func (f *Filter) BitsAllClearByBinary(key string, bin primitive.Binary) *Filter
- func (f *Filter) BitsAllClearByPositions(key string, pos []int) *Filter
- func (f *Filter) BitsAllSet(key string, mask int) *Filter
- func (f *Filter) BitsAllSetByBinary(key string, bin primitive.Binary) *Filter
- func (f *Filter) BitsAllSetByPositions(key string, pos []int) *Filter
- func (f *Filter) BitsAnyClear(key string, mask int) *Filter
- func (f *Filter) BitsAnyClearByBinary(key string, bin primitive.Binary) *Filter
- func (f *Filter) BitsAnyClearByPositions(key string, pos []int) *Filter
- func (f *Filter) BitsAnySet(key string, mask int) *Filter
- func (f *Filter) BitsAnySetByBinary(key string, bin primitive.Binary) *Filter
- func (f *Filter) BitsAnySetByPositions(key string, pos []int) *Filter
- func (f *Filter) ElemMatch(key string, sub *Filter) *Filter
- func (f *Filter) ElemMatchWithInterval(key string, interval *Interval) *Filter
- func (f *Filter) Eq(key string, val any) *Filter
- func (f *Filter) Exists(key string, val bool) *Filter
- func (f *Filter) Expr(expression any) *Filter
- func (f *Filter) Get(key string) (any, bool)
- func (f *Filter) Gt(key string, val any) *Filter
- func (f *Filter) Gte(key string, val any) *Filter
- func (f *Filter) In(key string, items []any) *Filter
- func (f *Filter) Like(key string, matcher *Matcher) *Filter
- func (f *Filter) Lt(key string, val any) *Filter
- func (f *Filter) Lte(key string, val any) *Filter
- func (f *Filter) MarshalBSON() ([]byte, error)
- func (f *Filter) MarshalJSON() ([]byte, error)
- func (f *Filter) Mod(key string, divisor, remainder float64) *Filter
- func (f *Filter) Ne(key string, val any) *Filter
- func (f *Filter) Nin(key string, items []any) *Filter
- func (f *Filter) Nor(others ...*Filter) *Filter
- func (f *Filter) Not(key string, sub *Filter) *Filter
- func (f *Filter) Or(others ...*Filter) *Filter
- func (f *Filter) Raw() rawbson.D
- func (f *Filter) Size(key string, size int64) *Filter
- func (f *Filter) Text(search *text.Search) *Filter
- func (f *Filter) ToMap() map[string]any
- func (f *Filter) Type(key string, val *DataType) *Filter
- func (f *Filter) UnmarshalBSON(bytes []byte) error
- func (f *Filter) UnmarshalJSON(bytes []byte) error
- func (f *Filter) Where(key, expression string) *Filter
- func (f *Filter) WithInterval(key string, val *Interval) *Filter
- type Interval
- func ClosedInterval(left, right any) *Interval
- func LeftHalfOpen(left, right any) *Interval
- func LeftHalfUnboundInterval(left any) *Interval
- func LeftUnboundInterval(left any) *Interval
- func OpenInterval(left, right any) *Interval
- func RightHalfOpen(left, right any) *Interval
- func RightHalfUnboundInterval(right any) *Interval
- func RightUnboundInterval(right any) *Interval
- type Matcher
- func (m *Matcher) AllowDotChar() *Matcher
- func (m *Matcher) Compile() primitive.Regex
- func (m *Matcher) Extended() *Matcher
- func (m *Matcher) IgnoreCase() *Matcher
- func (m *Matcher) MarshalBSON() ([]byte, error)
- func (m *Matcher) MarshalJSON() ([]byte, error)
- func (m *Matcher) MultilineMatch() *Matcher
- func (m *Matcher) UnmarshalBSON(bytes []byte) error
Constants ¶
View Source
const ( // IgnoreCase // Case insensitivity to match upper and lower cases. For an example, see // Perform Case-Insensitive Regular Expression Match. IgnoreCase = "i" // MultilineMatch // For patterns that include anchors (i.e. ^ for the start, $ for the end), // match at the beginning or end of each line for strings with multiline values. // Without this option, these anchors match at beginning or end of the string. // For an example, see Multiline Match for Lines Starting with Specified Pattern. // If the pattern contains no anchors or if the string value has no newline // characters (e.g. \n), the m option has no effect. MultilineMatch = "m" // Extended // "Extended" capability to ignore all white space characters in the $regex // pattern unless escaped or included in a character class. // Additionally, it ignores characters in-between and including an un-escaped // hash/pound (#) character and the next new line, so that you may include comments // in complicated patterns. This only applies to data characters; white space // characters may never appear within special character sequences in a pattern. // The x option does not affect the handling of the VT character (i.e. code 11). Extended = "x" // AllowDotChar // Allows the dot character (i.e. .) to match all characters including newline characters. // For an example, see Use the . Dot Character to Match New Line. AllowDotChar = "s" )
Variables ¶
View Source
var ( DataTypeDouble = &DataType{number: 1, alias: "double"} DataTypeString = &DataType{number: 2, alias: "string"} DataTypeObject = &DataType{number: 3, alias: "object"} DataTypeArray = &DataType{number: 4, alias: "array"} DataTypeBinaryData = &DataType{number: 5, alias: "binData"} DataTypeUndefined = &DataType{number: 6, alias: "undefined"} DataTypeObjectId = &DataType{number: 7, alias: "objectId"} DataTypeBool = &DataType{number: 8, alias: "bool"} DataTypeDate = &DataType{number: 9, alias: "date"} DataTypeNull = &DataType{number: 10, alias: "null"} DataTypeRegex = &DataType{number: 11, alias: "regex"} DataTypeDBPointer = &DataType{number: 12, alias: "dbPointer"} DataTypeJavascript = &DataType{number: 13, alias: "javascript"} DataTypeSymbol = &DataType{number: 14, alias: "symbol"} DataTypeJavascriptWithScope = &DataType{number: 15, alias: "javascriptWithScope"} DataTypeInt32 = &DataType{number: 16, alias: "int"} DataTypeTimestamp = &DataType{number: 17, alias: "timestamp"} DataTypeInt64 = &DataType{number: 18, alias: "long"} DataTypeDecimal128 = &DataType{number: 19, alias: "decimal"} DataTypeMinKey = &DataType{number: -1, alias: "minKey"} DataTypeMaxKey = &DataType{number: 127, alias: "maxKey"} )
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func BitsAllClear ¶
func BitsAllClearByPositions ¶
func BitsAllSet ¶
func BitsAllSetByPositions ¶
func BitsAnyClear ¶
func BitsAnyClearByPositions ¶
func BitsAnySet ¶
func BitsAnySetByPositions ¶
func ElemMatchWithInterval ¶ added in v0.0.26
func WithInterval ¶ added in v0.0.26
func (*Filter) BitsAllClearByBinary ¶
func (*Filter) BitsAllClearByPositions ¶
func (*Filter) BitsAllSetByBinary ¶
func (*Filter) BitsAllSetByPositions ¶
func (*Filter) BitsAnyClearByBinary ¶
func (*Filter) BitsAnyClearByPositions ¶
func (*Filter) BitsAnySetByBinary ¶
func (*Filter) BitsAnySetByPositions ¶
func (*Filter) ElemMatchWithInterval ¶ added in v0.0.26
func (*Filter) MarshalBSON ¶
func (*Filter) MarshalJSON ¶
func (*Filter) UnmarshalBSON ¶
func (*Filter) UnmarshalJSON ¶
type Interval ¶ added in v0.0.26
type Interval struct {
// contains filtered or unexported fields
}
func ClosedInterval ¶ added in v0.0.26
func LeftHalfOpen ¶ added in v0.0.26
func LeftHalfUnboundInterval ¶ added in v0.0.26
func LeftUnboundInterval ¶ added in v0.0.26
func OpenInterval ¶ added in v0.0.26
func RightHalfOpen ¶ added in v0.0.26
func RightHalfUnboundInterval ¶ added in v0.0.26
func RightUnboundInterval ¶ added in v0.0.26
type Matcher ¶ added in v0.0.26
type Matcher struct {
// contains filtered or unexported fields
}
func NewMatcher ¶ added in v0.0.26
func (*Matcher) AllowDotChar ¶ added in v0.0.26
func (*Matcher) IgnoreCase ¶ added in v0.0.26
func (*Matcher) MarshalBSON ¶ added in v0.0.26
func (*Matcher) MarshalJSON ¶ added in v0.0.26
func (*Matcher) MultilineMatch ¶ added in v0.0.26
func (*Matcher) UnmarshalBSON ¶ added in v0.0.26
Source Files ¶
Click to show internal directories.
Click to hide internal directories.