mongo

package
v0.0.0-...-2c5f5e2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Conf map[string]*Config
View Source
var Pipeline = new(Pl)

Functions

func Disconnect

func Disconnect() error

func GetClient

func GetClient(connName string) (*mongo.Client, error)

func GetDB

func GetDB(connName string) (*mongo.Database, error)

func GetDefaultDB

func GetDefaultDB() (*mongo.Database, error)

func Init

func Init(configs map[string]*Config) error

func StrID2ObjID

func StrID2ObjID(id string) interface{}

func StrIDs2ObjIDs

func StrIDs2ObjIDs(ids []string) []interface{}

func TimeoutCtx

func TimeoutCtx(timeout time.Duration) (context.Context, context.CancelFunc)

Types

type Config

type Config struct {
	URI         string
	DBName      string
	EnableTrace bool
}

type Pl

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

func (*Pl) AddFields

func (p *Pl) AddFields(cond interface{}) *Pl

func (*Pl) Bucket

func (p *Pl) Bucket(cond interface{}) *Pl

func (*Pl) ColStats

func (p *Pl) ColStats(cond interface{}) *Pl

func (*Pl) Count

func (p *Pl) Count(cond interface{}) *Pl

func (*Pl) CurrentOp

func (p *Pl) CurrentOp(cond interface{}) *Pl

func (*Pl) Extract

func (p *Pl) Extract() mongo2.Pipeline

func (*Pl) Facet

func (p *Pl) Facet(cond interface{}) *Pl

func (*Pl) GeoNear

func (p *Pl) GeoNear(cond interface{}) *Pl

func (*Pl) GraphLookup

func (p *Pl) GraphLookup(cond interface{}) *Pl

func (*Pl) Group

func (p *Pl) Group(cond interface{}) *Pl

func (*Pl) IndexStats

func (p *Pl) IndexStats(cond interface{}) *Pl

func (*Pl) Limit

func (p *Pl) Limit(cond interface{}) *Pl

func (*Pl) ListLocalSessions

func (p *Pl) ListLocalSessions(cond interface{}) *Pl

func (*Pl) ListSessions

func (p *Pl) ListSessions(cond interface{}) *Pl

func (*Pl) Lookup

func (p *Pl) Lookup(cond interface{}) *Pl

func (*Pl) Match

func (p *Pl) Match(cond interface{}) *Pl

func (*Pl) New

func (p *Pl) New() *Pl

func (*Pl) Out

func (p *Pl) Out(cond interface{}) *Pl

func (*Pl) Paginate

func (p *Pl) Paginate(page, pageSize int) *Pl

func (*Pl) Project

func (p *Pl) Project(cond interface{}) *Pl

func (*Pl) Redact

func (p *Pl) Redact(cond interface{}) *Pl

func (*Pl) ReplaceRoot

func (p *Pl) ReplaceRoot(cond interface{}) *Pl

func (*Pl) Sample

func (p *Pl) Sample(cond interface{}) *Pl

func (*Pl) Skip

func (p *Pl) Skip(cond interface{}) *Pl

func (*Pl) Sort

func (p *Pl) Sort(cond interface{}) *Pl

func (*Pl) SortByCount

func (p *Pl) SortByCount(cond interface{}) *Pl

func (*Pl) Unwind

func (p *Pl) Unwind(cond interface{}) *Pl

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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