Documentation ¶
Overview ¶
Copyright (c) 2023 the go-mongr8 Authors and Contributors [@see Authors file]
Licensed under the MIT License (https://opensource.org/licenses/MIT)
Copyright (c) 2023 the go-mongr8 Authors and Contributors [@see Authors file]
Licensed under the MIT License (https://opensource.org/licenses/MIT)
Index ¶
- Constants
- type IndexField
- type IndexSpec
- func CompoundIndex(fields ...IndexField) *IndexSpec
- func Geospatial2dsphereIndex(field IndexField) *IndexSpec
- func HashedIndex(field IndexField) *IndexSpec
- func RawIndex(fields map[string]interface{}, rules *map[string]interface{}) *IndexSpec
- func SingleFieldIndex(field IndexField) *IndexSpec
- func TextIndex(field IndexField) *IndexSpec
- func (b *IndexSpec) AsBackground() *IndexSpec
- func (b *IndexSpec) AsHidden() *IndexSpec
- func (b *IndexSpec) AsSparse() *IndexSpec
- func (b *IndexSpec) AsUnique() *IndexSpec
- func (b *IndexSpec) InitRules()
- func (b *IndexSpec) MustNotRaw()
- func (b *IndexSpec) SetCollation(collation map[string]interface{}) *IndexSpec
- func (b *IndexSpec) SetCustomIndexName(name string) *IndexSpec
- func (b *IndexSpec) SetPartialExpression(partialExp map[string]interface{}) *IndexSpec
- func (b *IndexSpec) SetRules(rules map[string]interface{})
- func (b *IndexSpec) SetTTL(expireAfterSeconds int32) *IndexSpec
- func (b *IndexSpec) Spec() *Spec
- type IndexType
- type Spec
Constants ¶
View Source
const ( // Index Types TypeSingleField IndexType = "TypeSingleField" TypeCompound IndexType = "TypeCompound" TypeText IndexType = "TypeText" TypeGeopatial2dsphere IndexType = "TypeGeopatial2dsphere" TypeHashed IndexType = "TypeHashedIndex" TypeRaw IndexType = "TypeRaw" // Index Options OptionSparse = "sparse" OptionBackground = "background" OptionUnique = "unique" OptionHidden = "hidden" OptionPartialFilterExp = "partialFilterExpression" OptionTTL = "expireAfterSeconds" OptionCollation = "collation" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexField ¶
type IndexField struct { Key string Value interface{} }
func Field ¶
func Field(name string, value ...interface{}) IndexField
func NewIndexField ¶
func NewIndexField(key string, value interface{}) IndexField
func (IndexField) NestedField ¶
func (f IndexField) NestedField(name string) IndexField
type IndexSpec ¶
type IndexSpec struct {
// contains filtered or unexported fields
}
func CompoundIndex ¶
func CompoundIndex(fields ...IndexField) *IndexSpec
func Geospatial2dsphereIndex ¶
func Geospatial2dsphereIndex(field IndexField) *IndexSpec
func HashedIndex ¶
func HashedIndex(field IndexField) *IndexSpec
func SingleFieldIndex ¶
func SingleFieldIndex(field IndexField) *IndexSpec
func TextIndex ¶
func TextIndex(field IndexField) *IndexSpec
func (*IndexSpec) AsBackground ¶
Set `background` option. Creates the index in the background so it doesn't block reads/writes.
func (*IndexSpec) AsHidden ¶
Set `hidden` option. Creates an index that is hidden from the query optimizer.
func (*IndexSpec) SetCollation ¶
Set `collation` option Creates index with custom collation
func (*IndexSpec) SetCustomIndexName ¶
func (*IndexSpec) SetPartialExpression ¶
Set `partialFilterExpression` option. Indexes with particular filters.
Click to show internal directories.
Click to hide internal directories.