Documentation ¶
Index ¶
- Constants
- func GetID(id interface{}) primitive.ObjectID
- func GetIDs(objs []mgm.DefaultModel) []primitive.ObjectID
- type Client
- type ClientsMap
- type Collection
- func (c Collection) Agregates(docs interface{}) error
- func (c Collection) AgregatesCount() ([]bson.M, error)
- func (c Collection) AgregatesCountWithCtx(ctx context.Context) ([]bson.M, error)
- func (c Collection) AgregatesWithCtx(ctx context.Context, docs interface{}) error
- func (c Collection) Count() (int64, error)
- func (c Collection) Create(obj mgm.Model) bool
- func (c *Collection) Drop(indexes ...Index) error
- func (c *Collection) Filters(f Filter) *Collection
- func (c Collection) Find(objs interface{}) error
- func (c Collection) FindById(id interface{}, obj mgm.Model) error
- func (c Collection) FindOne(obj mgm.Model) error
- func (c Collection) First(tsFrom, tsTo int64, obj mgm.Model) error
- func (c Collection) FirstTs(tsFrom, tsTo int64) int64
- func (c Collection) GetTss() ([]int64, error)
- func (c Collection) Last(tsFrom, tsTo int64, obj mgm.Model) error
- func (c *Collection) LastTs(tsFrom, tsTo int64) int64
- func (c *Collection) Limit(l int64) *Collection
- func (c Collection) Log()
- func (c *Collection) Pipeline(p Pipeline) *Collection
- func (c Collection) Prefix() string
- func (c *Collection) Sorts(s Sort) *Collection
- func (c Collection) Update(obj mgm.Model) bool
- func (c Collection) Upsert(obj mgm.Model, field string) bool
- type CollectionsMap
- type Connection
- type Database
- type DatabasesMap
- type Environment
- type Filter
- func (f *Filter) Append(field string, value interface{})
- func (f Filter) Fields() bson.D
- func (f *Filter) Gt(field string, value interface{})
- func (f *Filter) GtLt(field string, value_1, value_2 interface{})
- func (f *Filter) GtLte(field string, value_1, value_2 interface{})
- func (f *Filter) Gte(field string, value interface{})
- func (f *Filter) GteLt(field string, value_1, value_2 interface{})
- func (f *Filter) GteLte(field string, value_1, value_2 interface{})
- func (f *Filter) In(field string, values ...interface{})
- func (f *Filter) Like(field string, value string)
- func (f Filter) Log(msg string)
- func (f *Filter) Lt(field string, value interface{})
- func (f *Filter) Lte(field string, value interface{})
- func (f *Filter) Nin(field string, values ...interface{})
- type Index
- type Indexes
- type Manager
- type Pipeline
- type Sort
- type TsModel
Constants ¶
View Source
const ( // Environment EnvironmentWrite = Environment("write") EnvironmentRead = Environment("read") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientsMap ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (Collection) Agregates ¶
func (c Collection) Agregates(docs interface{}) error
func (Collection) AgregatesCount ¶
func (c Collection) AgregatesCount() ([]bson.M, error)
func (Collection) AgregatesCountWithCtx ¶
func (Collection) AgregatesWithCtx ¶
func (c Collection) AgregatesWithCtx(ctx context.Context, docs interface{}) error
func (*Collection) Drop ¶
func (c *Collection) Drop(indexes ...Index) error
func (*Collection) Filters ¶
func (c *Collection) Filters(f Filter) *Collection
func (Collection) FindById ¶
func (c Collection) FindById(id interface{}, obj mgm.Model) error
FindById
func (Collection) First ¶
func (c Collection) First(tsFrom, tsTo int64, obj mgm.Model) error
First, $gte: tsFrom $lt: tsTo, tsFrom = tsTo = 0 for "ts" first object,
func (Collection) FirstTs ¶
func (c Collection) FirstTs(tsFrom, tsTo int64) int64
Last, $gte: tsFrom $lt: tsTo, tsFrom = tsTo = 0 for first
func (Collection) GetTss ¶
func (c Collection) GetTss() ([]int64, error)
func (Collection) Last ¶
func (c Collection) Last(tsFrom, tsTo int64, obj mgm.Model) error
Last, $gte: tsFrom $lt: tsTo, tsFrom = tsTo = 0 for "ts" Last object,
func (*Collection) LastTs ¶
func (c *Collection) LastTs(tsFrom, tsTo int64) int64
Last, $gte: tsFrom $lt: tsTo, tsFrom = tsTo = 0 for last
func (*Collection) Limit ¶
func (c *Collection) Limit(l int64) *Collection
func (Collection) Log ¶
func (c Collection) Log()
func (*Collection) Pipeline ¶
func (c *Collection) Pipeline(p Pipeline) *Collection
func (Collection) Prefix ¶
func (c Collection) Prefix() string
func (*Collection) Sorts ¶
func (c *Collection) Sorts(s Sort) *Collection
type CollectionsMap ¶
type CollectionsMap map[string]*Collection
type Connection ¶
type Connection struct { Environment string `yaml: "environment"` Username string `yaml: "username"` Password string `yaml: "password"` Host string `yaml: "host"` Port string `yaml: "port"` AuthDatabase string `yaml: "authdatabase"` Tls bool `yaml: "tls"` Protocol string `yaml: "protocol"` AuthMechanism string `yaml: "authmechanism"` ReadPreference string `yaml: "readpreference"` DirectConnection bool `yaml: "directconnection"` }
Connection, Databases access data
type DatabasesMap ¶
type Environment ¶
type Environment string
type Filter ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() Manager
type Sort ¶
type Sort struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.