model

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 bson.ID] 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 bson.ID](r *mongo.BulkWriteResult) *BulkWriteResult[I]

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.Order]) *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 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 bson.ID] 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 bson.ID](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