Documentation ¶
Index ¶
- Constants
- func All[T any](values ...T) bson.D
- func And(conditions ...any) bson.D
- func ElemMatch(key string, cond any) bson.D
- func Eq(key string, value any) bson.D
- func Exists(key string, value bool) bson.D
- func Expr(value any) bson.D
- func Gt(key string, value any) bson.D
- func Gte(key string, value any) bson.D
- func Id(value any) bson.D
- func In[T any](key string, values ...T) bson.D
- func JsonSchema(value any) bson.D
- func Lt(key string, value any) bson.D
- func Lte(key string, value any) bson.D
- func Mod(key string, divisor any, remainder int) bson.D
- func NIn[T any](key string, values ...T) bson.D
- func Ne(key string, value any) bson.D
- func Nor(conditions ...any) bson.D
- func Not(cond any) bson.D
- func Or(conditions ...any) bson.D
- func Regex(key, value string) bson.D
- func RegexOptions(key, value, options string) bson.D
- func Size(key string, value int) bson.D
- func Slice(key string, number int) bson.D
- func SliceRanger(key string, start, end int) bson.D
- func Text(search string, opt *TextOptions) bson.D
- func Type(key string, value bsontype.Type) bson.D
- func TypeAlias(key string, value string) bson.D
- func TypeArray(key string, values ...bsontype.Type) bson.D
- func TypeArrayAlias(key string, values ...string) bson.D
- func Where(value string) bson.D
- type Builder
- func (b *Builder) All(key string, values ...any) *Builder
- func (b *Builder) AllFloat32(key string, values ...float32) *Builder
- func (b *Builder) AllFloat64(key string, values ...float64) *Builder
- func (b *Builder) AllInt(key string, values ...int) *Builder
- func (b *Builder) AllInt16(key string, values ...int16) *Builder
- func (b *Builder) AllInt32(key string, values ...int32) *Builder
- func (b *Builder) AllInt64(key string, values ...int64) *Builder
- func (b *Builder) AllInt8(key string, values ...int8) *Builder
- func (b *Builder) AllString(key string, values ...string) *Builder
- func (b *Builder) AllUint(key string, values ...uint) *Builder
- func (b *Builder) AllUint16(key string, values ...uint16) *Builder
- func (b *Builder) AllUint32(key string, values ...uint32) *Builder
- func (b *Builder) AllUint64(key string, values ...uint64) *Builder
- func (b *Builder) AllUint8(key string, values ...uint8) *Builder
- func (b *Builder) And(conditions ...any) *Builder
- func (b *Builder) Build() bson.D
- func (b *Builder) ElemMatch(key string, condition any) *Builder
- func (b *Builder) Eq(key string, value any) *Builder
- func (b *Builder) Exists(key string, exists bool) *Builder
- func (b *Builder) Expr(d bson.D) *Builder
- func (b *Builder) Gt(key string, value any) *Builder
- func (b *Builder) Gte(key string, value any) *Builder
- func (b *Builder) Id(v any) *Builder
- func (b *Builder) In(key string, values ...any) *Builder
- func (b *Builder) InFloat32(key string, values ...float32) *Builder
- func (b *Builder) InFloat64(key string, values ...float64) *Builder
- func (b *Builder) InInt(key string, values ...int) *Builder
- func (b *Builder) InInt16(key string, values ...int16) *Builder
- func (b *Builder) InInt32(key string, values ...int32) *Builder
- func (b *Builder) InInt64(key string, values ...int64) *Builder
- func (b *Builder) InInt8(key string, values ...int8) *Builder
- func (b *Builder) InString(key string, values ...string) *Builder
- func (b *Builder) InUint(key string, values ...uint) *Builder
- func (b *Builder) InUint16(key string, values ...uint16) *Builder
- func (b *Builder) InUint32(key string, values ...uint32) *Builder
- func (b *Builder) InUint64(key string, values ...uint64) *Builder
- func (b *Builder) InUint8(key string, values ...uint8) *Builder
- func (b *Builder) JsonSchema(value any) *Builder
- func (b *Builder) KeyValue(key string, value any) *Builder
- func (b *Builder) Lt(key string, value any) *Builder
- func (b *Builder) Lte(key string, value any) *Builder
- func (b *Builder) Mod(key string, divisor any, remainder int) *Builder
- func (b *Builder) Ne(key string, value any) *Builder
- func (b *Builder) Nin(key string, values ...any) *Builder
- func (b *Builder) NinFloat32(key string, values ...float32) *Builder
- func (b *Builder) NinFloat64(key string, values ...float64) *Builder
- func (b *Builder) NinInt(key string, values ...int) *Builder
- func (b *Builder) NinInt16(key string, values ...int16) *Builder
- func (b *Builder) NinInt32(key string, values ...int32) *Builder
- func (b *Builder) NinInt64(key string, values ...int64) *Builder
- func (b *Builder) NinInt8(key string, values ...int8) *Builder
- func (b *Builder) NinString(key string, values ...string) *Builder
- func (b *Builder) NinUint(key string, values ...uint) *Builder
- func (b *Builder) NinUint16(key string, values ...uint16) *Builder
- func (b *Builder) NinUint32(key string, values ...uint32) *Builder
- func (b *Builder) NinUint64(key string, values ...uint64) *Builder
- func (b *Builder) NinUint8(key string, values ...uint8) *Builder
- func (b *Builder) Nor(conditions ...any) *Builder
- func (b *Builder) Not(condition any) *Builder
- func (b *Builder) Or(conditions ...any) *Builder
- func (b *Builder) Regex(key, value string) *Builder
- func (b *Builder) RegexOptions(key, value, options string) *Builder
- func (b *Builder) Size(key string, size int) *Builder
- func (b *Builder) Slice(key string, number int) *Builder
- func (b *Builder) SliceRanger(key string, start, end int) *Builder
- func (b *Builder) Text(value, language string, caseSensitive, diacriticSensitive bool) *Builder
- func (b *Builder) Type(key string, t bsontype.Type) *Builder
- func (b *Builder) TypeAlias(key string, alias string) *Builder
- func (b *Builder) TypeArray(key string, ts ...bsontype.Type) *Builder
- func (b *Builder) TypeArrayAlias(key string, aliases ...string) *Builder
- func (b *Builder) Where(value string) *Builder
- type TextOptions
Constants ¶
const ( AllOp = "$all" AndOp = "$and" CaseSensitiveOp = "$caseSensitive" DiacriticSensitiveOp = "$diacriticSensitive" ElemMatchOp = "$elemMatch" EqOp = "$eq" ExistsOp = "$exists" ExprOp = "$expr" GtOp = "$gt" GteOp = "$gte" IdOp = "_id" InOp = "$in" JsonSchemaOp = "$jsonSchema" LanguageOp = "$language" LtOp = "$lt" LteOp = "$lte" ModOp = "$mod" NeOp = "$ne" NinOp = "$nin" NorOp = "$nor" NotOp = "$not" OptionsOp = "$options" OrOp = "$or" RegexOp = "$regex" SearchOp = "$search" SizeOp = "$size" SliceOp = "$slice" TextOp = "$text" TypeOp = "$type" WhereOp = "$where" )
Variables ¶
This section is empty.
Functions ¶
func JsonSchema ¶ added in v0.3.0
func RegexOptions ¶ added in v0.3.0
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶ added in v1.0.0
func NewBuilder() *Builder
func (*Builder) All ¶
All appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllFloat32 ¶
AllFloat32 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllFloat64 ¶
AllFloat64 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllInt ¶
AllInt appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllInt16 ¶
AllInt16 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllInt32 ¶
AllInt32 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllInt64 ¶
AllInt64 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllInt8 ¶
AllInt8 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllString ¶
AllString appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllUint ¶
AllUint appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllUint16 ¶
AllUint16 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllUint32 ¶
AllUint32 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllUint64 ¶
AllUint64 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) AllUint8 ¶
AllUint8 appends an element with '$all' key and given value to the builder's data slice.
func (*Builder) ElemMatch ¶
ElemMatch appends an element with '$elemMatch' key and given value to the builder's data slice.
func (*Builder) Id ¶
Id appends an element with '_id' key and given value to the builder's data slice.
func (*Builder) JsonSchema ¶
func (*Builder) KeyValue ¶ added in v1.0.0
KeyValue appends given key-value pair to the builder's data slice.
func (*Builder) NinFloat32 ¶
func (*Builder) NinFloat64 ¶
func (*Builder) RegexOptions ¶
func (*Builder) Size ¶
Size appends an element with '$size' key and given value to the builder's data slice.
func (*Builder) SliceRanger ¶
func (*Builder) Text ¶
Text 如果 language 的值为零值,则不作为查询条件 If the value of language is zero, it is not used as a query condition 如果 caseSensitive 的值为零值,则不作为查询条件 If the value of caseSensitive is zero, it is not used as a query condition 如果 diacriticSensitive 的值为零值,则不作为查询条件 If the value of diacriticSensitive is zero, it is not used as a query condition