primitives

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolField

type BoolField struct {
	// contains filtered or unexported fields
}

func BoolType

func BoolType(name string) *BoolField

func (*BoolField) BSONName

func (f *BoolField) BSONName() string

func (*BoolField) Eq

func (f *BoolField) Eq(v bool) bson.M

This method generates a query for equality, e.g., {field: value}

func (*BoolField) Exists

func (f *BoolField) Exists() bson.M

This method generates a query to check if the field exists, e.g., {field: {$exists: true}}

func (*BoolField) In

func (f *BoolField) In(v []bool) bson.M

This method generates a query for multiple values, e.g., {field: {$in: [value1, value2, ...]}}

func (*BoolField) IsNotNull

func (f *BoolField) IsNotNull() bson.M

This method generates a query to check if the field is not null, e.g., {field: {$ne: null}}

func (*BoolField) IsNull

func (f *BoolField) IsNull() bson.M

This method generates a query to check if the field is null, e.g., {field: null}

func (*BoolField) Ne

func (f *BoolField) Ne(v bool) bson.M

This method generates a query for inequality, e.g., {field: {$ne: value}}

func (*BoolField) Nin

func (f *BoolField) Nin(v []bool) bson.M

This method generates a query for values not in the given list, e.g., {field: {$nin: [value1, value2, ...]}}

func (*BoolField) NotExists

func (f *BoolField) NotExists() bson.M

This method generates a query to check if the field does not exist, e.g., {field: {$exists: false}}

type Decimal128Field added in v1.0.24

type Decimal128Field struct {
	// contains filtered or unexported fields
}

func Decimal128Type added in v1.0.24

func Decimal128Type(name string) *Decimal128Field

func (*Decimal128Field) BSONName added in v1.0.24

func (f *Decimal128Field) BSONName() string

func (*Decimal128Field) Eq added in v1.0.24

func (*Decimal128Field) Exists added in v1.0.24

func (f *Decimal128Field) Exists() bson.M

func (*Decimal128Field) Gt added in v1.0.24

func (*Decimal128Field) Gte added in v1.0.24

func (f *Decimal128Field) Gte(v bson.Decimal128) bson.M

func (*Decimal128Field) In added in v1.0.24

func (f *Decimal128Field) In(v []bson.Decimal128) bson.M

func (*Decimal128Field) IsNotNull added in v1.0.24

func (f *Decimal128Field) IsNotNull() bson.M

func (*Decimal128Field) IsNull added in v1.0.24

func (f *Decimal128Field) IsNull() bson.M

func (*Decimal128Field) Lt added in v1.0.24

func (*Decimal128Field) Lte added in v1.0.24

func (f *Decimal128Field) Lte(v bson.Decimal128) bson.M

func (*Decimal128Field) Ne added in v1.0.24

func (*Decimal128Field) Nin added in v1.0.24

func (f *Decimal128Field) Nin(v []bson.Decimal128) bson.M

func (*Decimal128Field) NotExists added in v1.0.24

func (f *Decimal128Field) NotExists() bson.M

type Float64Field

type Float64Field struct {
	// contains filtered or unexported fields
}

func Float64Type

func Float64Type(name string) *Float64Field

func (*Float64Field) BSONName

func (f *Float64Field) BSONName() string

func (*Float64Field) Eq

func (f *Float64Field) Eq(v float64) bson.M

This method generates a query for equality, e.g., {field: value}

func (*Float64Field) Exists

func (f *Float64Field) Exists() bson.M

This method generates a query to check if the field exists, e.g., {field: {$exists: true}}

func (*Float64Field) Gt

func (f *Float64Field) Gt(v float64) bson.M

This method generates a query for greater than, e.g., {field: {$gt: value}}

func (*Float64Field) Gte

func (f *Float64Field) Gte(v float64) bson.M

This method generates a query for greater than or equal to, e.g., {field: {$gte: value}}

func (*Float64Field) In

func (f *Float64Field) In(v []float64) bson.M

This method generates a query for multiple values, e.g., {field: {$in: [value1, value2, ...]}}

func (*Float64Field) IsNotNull

func (f *Float64Field) IsNotNull() bson.M

This method generates a query to check if the field is not null, e.g., {field: {$ne: null}}

func (*Float64Field) IsNull

func (f *Float64Field) IsNull() bson.M

This method generates a query to check if the field is null, e.g., {field: null}

func (*Float64Field) Lt

func (f *Float64Field) Lt(v float64) bson.M

This method generates a query for less than, e.g., {field: {$lt: value}}

func (*Float64Field) Lte

func (f *Float64Field) Lte(v float64) bson.M

This method generates a query for less than or equal to, e.g., {field: {$lte: value}}

func (*Float64Field) Ne

func (f *Float64Field) Ne(v float64) bson.M

This method generates a query for inequality, e.g., {field: {$ne: value}}

func (*Float64Field) Nin

func (f *Float64Field) Nin(v []float64) bson.M

This method generates a query for values not in the given list, e.g., {field: {$nin: [value1, value2, ...]}}

func (*Float64Field) NotExists

func (f *Float64Field) NotExists() bson.M

This method generates a query to check if the field does not exist, e.g., {field: {$exists: false}}

type GenericField

type GenericField struct {
	// contains filtered or unexported fields
}

func GenericType

func GenericType(name string) *GenericField

func (*GenericField) BSONName

func (f *GenericField) BSONName() string

func (*GenericField) Contains added in v1.0.3

func (f *GenericField) Contains(v any) bson.M

func (*GenericField) ContainsAll added in v1.0.3

func (f *GenericField) ContainsAll(v []any) bson.M

func (*GenericField) ElemMatch added in v1.0.3

func (f *GenericField) ElemMatch(v bson.M) bson.M

func (*GenericField) Eq added in v1.0.3

func (f *GenericField) Eq(v any) bson.M

func (*GenericField) Exists added in v1.0.3

func (f *GenericField) Exists() bson.M

func (*GenericField) In added in v1.0.3

func (f *GenericField) In(v []any) bson.M

func (*GenericField) IsNotNull added in v1.0.3

func (f *GenericField) IsNotNull() bson.M

func (*GenericField) IsNull added in v1.0.3

func (f *GenericField) IsNull() bson.M

func (*GenericField) Ne added in v1.0.3

func (f *GenericField) Ne(v any) bson.M

func (*GenericField) Nin added in v1.0.3

func (f *GenericField) Nin(v []any) bson.M

func (*GenericField) NotExists added in v1.0.3

func (f *GenericField) NotExists() bson.M

func (*GenericField) Path added in v1.0.3

func (f *GenericField) Path(path string) *GenericField

func (*GenericField) Size added in v1.0.3

func (f *GenericField) Size(v int) bson.M

type GeoField

type GeoField struct {
	// contains filtered or unexported fields
}

func GeoType

func GeoType(name string) *GeoField

func (*GeoField) BSONName

func (f *GeoField) BSONName() string

func (*GeoField) Eq

func (f *GeoField) Eq(v any) bson.M

func (*GeoField) Exists

func (f *GeoField) Exists() bson.M

func (*GeoField) Intersects

func (f *GeoField) Intersects(geometry any) bson.M

func (*GeoField) IsNotNull

func (f *GeoField) IsNotNull() bson.M

func (*GeoField) IsNull

func (f *GeoField) IsNull() bson.M

func (*GeoField) Ne

func (f *GeoField) Ne(v any) bson.M

func (*GeoField) Near

func (f *GeoField) Near(geometry any) bson.M

func (*GeoField) NearSphere

func (f *GeoField) NearSphere(geometry any) bson.M

func (*GeoField) NearSphereWithDistance

func (f *GeoField) NearSphereWithDistance(geometry any, minDistance *float64, maxDistance *float64) bson.M

func (*GeoField) NearWithDistance

func (f *GeoField) NearWithDistance(geometry any, minDistance *float64, maxDistance *float64) bson.M

func (*GeoField) NotExists

func (f *GeoField) NotExists() bson.M

func (*GeoField) Within

func (f *GeoField) Within(geometry any) bson.M

func (*GeoField) WithinBox

func (f *GeoField) WithinBox(bottomLeft []float64, upperRight []float64) bson.M

func (*GeoField) WithinCenter

func (f *GeoField) WithinCenter(center []float64, radius float64) bson.M

func (*GeoField) WithinCenterSphere

func (f *GeoField) WithinCenterSphere(center []float64, radius float64) bson.M

type Int64Field

type Int64Field struct {
	// contains filtered or unexported fields
}

func Int64Type

func Int64Type(name string) *Int64Field

func (*Int64Field) BSONName

func (f *Int64Field) BSONName() string

func (*Int64Field) Eq

func (f *Int64Field) Eq(v int64) bson.M

This method generates a query for equality, e.g., {field: value}

func (*Int64Field) Exists

func (f *Int64Field) Exists() bson.M

This method generates a query to check if the field exists, e.g., {field: {$exists: true}}

func (*Int64Field) Gt

func (f *Int64Field) Gt(v int64) bson.M

This method generates a query for greater than, e.g., {field: {$gt: value}}

func (*Int64Field) Gte

func (f *Int64Field) Gte(v int64) bson.M

This method generates a query for greater than or equal to, e.g., {field: {$gte: value}}

func (*Int64Field) In

func (f *Int64Field) In(v []int64) bson.M

This method generates a query for multiple values, e.g., {field: {$in: [value1, value2, ...]}}

func (*Int64Field) IsNotNull

func (f *Int64Field) IsNotNull() bson.M

This method generates a query to check if the field is not null, e.g., {field: {$ne: null}}

func (*Int64Field) IsNull

func (f *Int64Field) IsNull() bson.M

This method generates a query to check if the field is null, e.g., {field: null}

func (*Int64Field) Lt

func (f *Int64Field) Lt(v int64) bson.M

This method generates a query for less than, e.g., {field: {$lt: value}}

func (*Int64Field) Lte

func (f *Int64Field) Lte(v int64) bson.M

This method generates a query for less than or equal to, e.g., {field: {$lte: value}}

func (*Int64Field) Ne

func (f *Int64Field) Ne(v int64) bson.M

This method generates a query for inequality, e.g., {field: {$ne: value}}

func (*Int64Field) Nin

func (f *Int64Field) Nin(v []int64) bson.M

This method generates a query for values not in the given list, e.g., {field: {$nin: [value1, value2, ...]}}

func (*Int64Field) NotExists

func (f *Int64Field) NotExists() bson.M

This method generates a query to check if the field does not exist, e.g., {field: {$exists: false}}

type ObjectIDField

type ObjectIDField struct {
	// contains filtered or unexported fields
}

func ObjectIDType

func ObjectIDType(name string) *ObjectIDField

func (*ObjectIDField) BSONName

func (f *ObjectIDField) BSONName() string

func (*ObjectIDField) Eq

func (f *ObjectIDField) Eq(v bson.ObjectID) bson.M

This method generates a query for equality, e.g., {field: value}

func (*ObjectIDField) Exists

func (f *ObjectIDField) Exists() bson.M

This method generates a query to check if the field exists, e.g., {field: {$exists: true}}

func (*ObjectIDField) Gt

func (f *ObjectIDField) Gt(v bson.ObjectID) bson.M

This method generates a query for greater than, e.g., {field: {$gt: value}}

func (*ObjectIDField) Gte

func (f *ObjectIDField) Gte(v bson.ObjectID) bson.M

This method generates a query for greater than or equal, e.g., {field: {$gte: value}}

func (*ObjectIDField) In

func (f *ObjectIDField) In(v []bson.ObjectID) bson.M

This method generates a query for multiple values, e.g., {field: {$in: [value1, value2, ...]}}

func (*ObjectIDField) IsNotNull

func (f *ObjectIDField) IsNotNull() bson.M

This method generates a query to check if the field is not null, e.g., {field: {$ne: null}}

func (*ObjectIDField) IsNull

func (f *ObjectIDField) IsNull() bson.M

This method generates a query to check if the field is null, e.g., {field: null}

func (*ObjectIDField) Lt

func (f *ObjectIDField) Lt(v bson.ObjectID) bson.M

This method generates a query for less than, e.g., {field: {$lt: value}}

func (*ObjectIDField) Lte

func (f *ObjectIDField) Lte(v bson.ObjectID) bson.M

This method generates a query for less than or equal, e.g., {field: {$lte: value}}

func (*ObjectIDField) Ne

func (f *ObjectIDField) Ne(v bson.ObjectID) bson.M

This method generates a query for inequality, e.g., {field: {$ne: value}}

func (*ObjectIDField) Nin

func (f *ObjectIDField) Nin(v []bson.ObjectID) bson.M

This method generates a query for values not in the given list, e.g., {field: {$nin: [value1, value2, ...]}}

func (*ObjectIDField) NotExists

func (f *ObjectIDField) NotExists() bson.M

This method generates a query to check if the field does not exist, e.g., {field: {$exists: false}}

type StringArrayField added in v1.0.3

type StringArrayField struct {
	// contains filtered or unexported fields
}

func StringArrayType added in v1.0.3

func StringArrayType(name string) *StringArrayField

func (*StringArrayField) BSONName added in v1.0.3

func (f *StringArrayField) BSONName() string

func (*StringArrayField) Contains added in v1.0.3

func (f *StringArrayField) Contains(v string) bson.M

func (*StringArrayField) ContainsAll added in v1.0.3

func (f *StringArrayField) ContainsAll(v []string) bson.M

func (*StringArrayField) ElemMatch added in v1.0.3

func (f *StringArrayField) ElemMatch(v bson.M) bson.M

func (*StringArrayField) Eq added in v1.0.3

func (f *StringArrayField) Eq(v []string) bson.M

func (*StringArrayField) Exists added in v1.0.3

func (f *StringArrayField) Exists() bson.M

func (*StringArrayField) In added in v1.0.3

func (f *StringArrayField) In(v []string) bson.M

func (*StringArrayField) IsNotNull added in v1.0.3

func (f *StringArrayField) IsNotNull() bson.M

func (*StringArrayField) IsNull added in v1.0.3

func (f *StringArrayField) IsNull() bson.M

func (*StringArrayField) Ne added in v1.0.3

func (f *StringArrayField) Ne(v []string) bson.M

func (*StringArrayField) Nin added in v1.0.3

func (f *StringArrayField) Nin(v []string) bson.M

func (*StringArrayField) NotExists added in v1.0.3

func (f *StringArrayField) NotExists() bson.M

func (*StringArrayField) Size added in v1.0.3

func (f *StringArrayField) Size(v int) bson.M

type StringField

type StringField struct {
	// contains filtered or unexported fields
}

func StringType

func StringType(name string) *StringField

func (*StringField) BSONName

func (f *StringField) BSONName() string

func (*StringField) Eq

func (f *StringField) Eq(v string) bson.M

This method generates a query for equality, e.g., {field: value}

func (*StringField) Exists

func (f *StringField) Exists() bson.M

This method generates a query to check if the field exists, e.g., {field: {$exists: true}}

func (*StringField) In

func (f *StringField) In(v []string) bson.M

This method generates a query for multiple values, e.g., {field: {$in: [value1, value2, ...]}}

func (*StringField) IsNotNull

func (f *StringField) IsNotNull() bson.M

This method generates a query to check if the field is not null, e.g., {field: {$ne: null}}

func (*StringField) IsNull

func (f *StringField) IsNull() bson.M

This method generates a query to check if the field is null, e.g., {field: null}

func (*StringField) Ne

func (f *StringField) Ne(v string) bson.M

This method generates a query for inequality, e.g., {field: {$ne: value}}

func (*StringField) Nin

func (f *StringField) Nin(v []string) bson.M

This method generates a query for values not in the given list, e.g., {field: {$nin: [value1, value2, ...]}}

func (*StringField) NotExists

func (f *StringField) NotExists() bson.M

This method generates a query to check if the field does not exist, e.g., {field: {$exists: false}}

func (*StringField) Reg

func (f *StringField) Reg(v string) bson.M

This method generates a query for regular expression matching, e.g., {field: {$regex: value}}

type TimestampField

type TimestampField struct {
	// contains filtered or unexported fields
}

func TimestampType

func TimestampType(name string) *TimestampField

func (*TimestampField) BSONName

func (f *TimestampField) BSONName() string

func (*TimestampField) Eq

func (f *TimestampField) Eq(v time.Time) bson.M

This method generates a query for equality, e.g., {field: value}

func (*TimestampField) Exists

func (f *TimestampField) Exists() bson.M

This method generates a query to check if the field exists, e.g., {field: {$exists: true}}

func (*TimestampField) Gt

func (f *TimestampField) Gt(v time.Time) bson.M

This method generates a query for greater than, e.g., {field: {$gt: value}}

func (*TimestampField) Gte

func (f *TimestampField) Gte(v time.Time) bson.M

This method generates a query for greater than or equal to, e.g., {field: {$gte: value}}

func (*TimestampField) In

func (f *TimestampField) In(v []time.Time) bson.M

This method generates a query for multiple values, e.g., {field: {$in: [value1, value2, ...]}}

func (*TimestampField) IsNotNull

func (f *TimestampField) IsNotNull() bson.M

This method generates a query to check if the field is not null, e.g., {field: {$ne: null}}

func (*TimestampField) IsNull

func (f *TimestampField) IsNull() bson.M

This method generates a query to check if the field is null, e.g., {field: null}

func (*TimestampField) Lt

func (f *TimestampField) Lt(v time.Time) bson.M

This method generates a query for less than, e.g., {field: {$lt: value}}

func (*TimestampField) Lte

func (f *TimestampField) Lte(v time.Time) bson.M

This method generates a query for less than or equal to, e.g., {field: {$lte: value}}

func (*TimestampField) Ne

func (f *TimestampField) Ne(v time.Time) bson.M

This method generates a query for inequality, e.g., {field: {$ne: value}}

func (*TimestampField) Nin

func (f *TimestampField) Nin(v []time.Time) bson.M

This method generates a query for values not in the given list, e.g., {field: {$nin: [value1, value2, ...]}}

func (*TimestampField) NotExists

func (f *TimestampField) NotExists() bson.M

This method generates a query to check if the field does not exist, e.g., {field: {$exists: false}}

Jump to

Keyboard shortcuts

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