schema

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collation added in v0.0.6

type Collation struct {
	Locale          string `bson:"locale"`
	CaseLevel       *bool  `bson:"caseLevel,omitempty"`
	CaseFirst       string `bson:"caseFirst,omitempty"`
	Strength        int    `bson:"strength,omitempty"`
	NumericOrdering *bool  `bson:"numericOrdering,omitempty"`
	Alternate       string `bson:"alternate,omitempty"`
	MaxVariable     string `bson:"maxVariable,omitempty"`
	Normalization   *bool  `bson:"normalization,omitempty"`
	Backwards       *bool  `bson:"backwards,omitempty"`
}

Collation specifies language-specific rules for string comparison

type Index

type Index struct {
	Key                     bson.D     `bson:"key"`
	Name                    string     `bson:"name"`
	Background              bool       `bson:"background,omitempty"`
	Unique                  bool       `bson:"unique,omitempty"`
	Sparse                  bool       `bson:"sparse,omitempty"`
	ExpireAfterSeconds      *int32     `bson:"expireAfterSeconds,omitempty"`
	StorageEngine           bson.M     `bson:"storageEngine,omitempty"`
	PartialFilterExpression bson.M     `bson:"partialFilterExpression,omitempty"`
	Collation               *Collation `bson:"collation,omitempty"`
	DefaultLanguage         string     `bson:"default_language,omitempty"`
	LanguageOverride        string     `bson:"language_override,omitempty"`
	TextIndexVersion        int        `bson:"textIndexVersion,omitempty"`
	Weights                 bson.D     `bson:"weights,omitempty"`
	Hidden                  bool       `bson:"hidden,omitempty"`
	WildcardProjection      bson.M     `bson:"wildcardProjection,omitempty"`
}

Index represents a MongoDB index configuration

func (Index) MarshalJSON added in v0.0.6

func (i Index) MarshalJSON() ([]byte, error)

func (*Index) UnmarshalJSON added in v0.0.6

func (i *Index) UnmarshalJSON(bytes []byte) error

type Schema

type Schema struct {
	Collection string  `json:"collection"`
	Indexes    []Index `json:"indexes"`
}

Schema represents a MongoDB collection schema

Jump to

Keyboard shortcuts

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