Versions in this module Expand all Collapse all v1 v1.0.2 May 10, 2023 Changes in this version + type Bulk struct + func (b *Bulk) Run() (result *mgo.BulkResult, err error) + type Collection struct + func (c *Collection) Bulk() *Bulk + func (c *Collection) Count() (n int, err error) + func (c *Collection) Create(info *mgo.CollectionInfo) error + func (c *Collection) DropCollection() error + func (c *Collection) DropIndex(key ...string) error + func (c *Collection) DropIndexName(name string) error + func (c *Collection) EnsureIndex(index mgo.Index) error + func (c *Collection) EnsureIndexKey(key ...string) error + func (c *Collection) Find(query interface{}) *Query + func (c *Collection) FindId(id interface{}) *Query + func (c *Collection) Indexes() (indexes []mgo.Index, err error) + func (c *Collection) Insert(docs ...interface{}) error + func (c *Collection) NewIter(session *mgo.Session, firstBatch []bson.Raw, cursorId int64, err error) *Iter + func (c *Collection) Pipe(pipeline interface{}) *Pipe + func (c *Collection) Remove(selector interface{}) error + func (c *Collection) RemoveAll(selector interface{}) (info *mgo.ChangeInfo, err error) + func (c *Collection) RemoveId(id interface{}) error + func (c *Collection) Repair() *Iter + func (c *Collection) Update(selector interface{}, update interface{}) error + func (c *Collection) UpdateAll(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error) + func (c *Collection) UpdateId(id interface{}, update interface{}) error + func (c *Collection) Upsert(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error) + func (c *Collection) UpsertId(id interface{}, update interface{}) (info *mgo.ChangeInfo, err error) + type Database struct + func (db *Database) C(name string) *Collection + type DialOption func(*mongoConfig) + func WithAnalytics(on bool) DialOption + func WithAnalyticsRate(rate float64) DialOption + func WithContext(ctx context.Context) DialOption + func WithServiceName(name string) DialOption + type Iter struct + func (iter *Iter) All(result interface{}) (err error) + func (iter *Iter) Close() (err error) + func (iter *Iter) For(result interface{}, f func() error) (err error) + func (iter *Iter) Next(result interface{}) bool + type Pipe struct + func (p *Pipe) All(result interface{}) error + func (p *Pipe) Explain(result interface{}) (err error) + func (p *Pipe) Iter() *Iter + func (p *Pipe) One(result interface{}) (err error) + type Query struct + func (q *Query) All(result interface{}) error + func (q *Query) Apply(change mgo.Change, result interface{}) (info *mgo.ChangeInfo, err error) + func (q *Query) Count() (n int, err error) + func (q *Query) Distinct(key string, result interface{}) error + func (q *Query) Explain(result interface{}) error + func (q *Query) For(result interface{}, f func() error) error + func (q *Query) Iter() *Iter + func (q *Query) MapReduce(job *mgo.MapReduce, result interface{}) (info *mgo.MapReduceInfo, err error) + func (q *Query) One(result interface{}) error + func (q *Query) Tail(timeout time.Duration) *Iter + type Session struct + func Dial(url string, opts ...DialOption) (*Session, error) + func (s *Session) DB(name string) *Database + func (s *Session) Run(cmd interface{}, result interface{}) (err error)