model

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 Addr added in v0.0.21

type Addr struct {
	Host string
	Port int
}

func (*Addr) String added in v0.0.21

func (a *Addr) String() string

type Bson added in v0.0.21

type Bson interface {
	bson.M | bson.D | bson.A | bson.E
}

type BulkWriteResult added in v0.0.21

type BulkWriteResult[I DocumentId] struct {
	// The number of documents inserted.
	InsertedCount int64

	// The number of documents matched by filters in update and replace operations.
	MatchedCount int64

	// The number of documents modified by update and replace operations.
	ModifiedCount int64

	// The number of documents deleted.
	DeletedCount int64

	// The number of documents upserted by update and replace operations.
	UpsertedCount int64

	// A map of operation index to the _id of each upserted document.
	UpsertedIDs map[int64]I
}

BulkWriteResult is the result type returned by a BulkWrite operation.

func FromBulkWriteResult added in v0.0.21

func FromBulkWriteResult[I DocumentId](r *mongo.BulkWriteResult) *BulkWriteResult[I]

type DataType added in v0.0.21

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

func (*DataType) Alias added in v0.0.21

func (d *DataType) Alias() string

func (*DataType) Order added in v0.0.21

func (d *DataType) Order() int8

type Float added in v0.0.21

type Float interface {
	~float32 | ~float64
}

type Index added in v0.0.21

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

func From added in v0.0.21

func From(model *mongo.IndexModel) *Index

func NewIndex added in v0.0.21

func NewIndex(keys ...Pair[sorts.SortOrder]) *Index

func (*Index) Background deprecated added in v0.0.21

func (i *Index) Background() *Index

Background sets value for the Background field.

Deprecated: This option has been deprecated in MongoDB version 4.2.

func (*Index) Bits added in v0.0.21

func (i *Index) Bits(bits int32) *Index

Bits sets the value for the Bits field.

func (*Index) BucketSize added in v0.0.21

func (i *Index) BucketSize(bucketSize int32) *Index

BucketSize sets the value for the BucketSize field

func (*Index) Collation added in v0.0.21

func (i *Index) Collation(collation *rawopts.Collation) *Index

Collation sets the value for the Collation field.

func (*Index) DefaultLanguage added in v0.0.21

func (i *Index) DefaultLanguage(language string) *Index

DefaultLanguage sets the value for the DefaultLanguage field.

func (*Index) ExpireAfterSeconds added in v0.0.21

func (i *Index) ExpireAfterSeconds(seconds int32) *Index

ExpireAfterSeconds sets value for the ExpireAfterSeconds field.

func (*Index) Hidden added in v0.0.21

func (i *Index) Hidden() *Index

Hidden sets the value for the Hidden field.

func (*Index) LanguageOverride added in v0.0.21

func (i *Index) LanguageOverride(override string) *Index

LanguageOverride sets the value of the LanguageOverride field.

func (*Index) Marshal added in v0.0.21

func (i *Index) Marshal() mongo.IndexModel

func (*Index) Max added in v0.0.21

func (i *Index) Max(max float64) *Index

Max sets the value for the Max field.

func (*Index) Min added in v0.0.21

func (i *Index) Min(min float64) *Index

Min sets the value for the Min field.

func (*Index) Name added in v0.0.21

func (i *Index) Name(name string) *Index

Name sets the value for the Name field.

func (*Index) PartialFilterExpression added in v0.0.21

func (i *Index) PartialFilterExpression(expression interface{}) *Index

PartialFilterExpression sets the value for the PartialFilterExpression field.

func (*Index) Sparse added in v0.0.21

func (i *Index) Sparse() *Index

Sparse sets the value of the Sparse field.

func (*Index) SphereVersion added in v0.0.21

func (i *Index) SphereVersion(version int32) *Index

SphereVersion sets the value for the SphereVersion field.

func (*Index) StorageEngine added in v0.0.21

func (i *Index) StorageEngine(engine interface{}) *Index

StorageEngine sets the value for the StorageEngine field.

func (*Index) TextVersion added in v0.0.21

func (i *Index) TextVersion(version int32) *Index

TextVersion sets the value for the TextVersion field.

func (*Index) Unique added in v0.0.21

func (i *Index) Unique() *Index

Unique sets the value for the Unique field.

func (*Index) Version added in v0.0.21

func (i *Index) Version(version int32) *Index

Version sets the value for the Version field.

func (*Index) Weights added in v0.0.21

func (i *Index) Weights(weights interface{}) *Index

Weights sets the value for the Weights field.

func (*Index) WildcardProjection added in v0.0.21

func (i *Index) WildcardProjection(wildcardProjection interface{}) *Index

WildcardProjection sets the value for the WildcardProjection field.

type Int added in v0.0.21

type Int interface {
	~int | ~int32 | ~int64
}

type Number added in v0.0.21

type Number interface {
	Int | Float
}

type Pair added in v0.0.21

type Pair[V any] struct {
	Key   string
	Value V
}

type UpdateResult added in v0.0.21

type UpdateResult[I DocumentId] struct {
	MatchedCount  int64 // The number of documents matched by the filter.
	ModifiedCount int64 // The number of documents modified by the operation.
	UpsertedCount int64 // The number of documents upserted by the operation.
	UpsertedID    I     // The _id field of the upserted document, or nil if no upsert was done.
}

func FromUpdateResult added in v0.0.21

func FromUpdateResult[I DocumentId](r *mongo.UpdateResult) *UpdateResult[I]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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