Documentation
¶
Index ¶
- Constants
- type MgoDB
- func (m *MgoDB) BulkInsert(docs ...interface{}) (*mgo.BulkResult, error)
- func (m *MgoDB) BulkRemove(selector ...interface{}) (*mgo.BulkResult, error)
- func (m *MgoDB) BulkRemoveAll(selector ...interface{}) (*mgo.BulkResult, error)
- func (m *MgoDB) BulkUpdate(pairs ...interface{}) (*mgo.BulkResult, error)
- func (m *MgoDB) BulkUpdateAll(pairs ...interface{}) (*mgo.BulkResult, error)
- func (m *MgoDB) BulkUpsert(pairs ...interface{}) (*mgo.BulkResult, error)
- func (m *MgoDB) Count(query interface{}) (int, error)
- func (m *MgoDB) Explain(pipeline, result interface{}) error
- func (m *MgoDB) FindAll(query, selector, result interface{}) error
- func (m *MgoDB) FindIter(query interface{}) (*mgo.Iter, error)
- func (m *MgoDB) FindOne(query, selector, result interface{}) error
- func (m *MgoDB) FindPage(page, limit int, query, selector, result interface{}) error
- func (m *MgoDB) FindPageReverse(page, limit int, query, selector, result interface{}) error
- func (m *MgoDB) GridFSCreate(prefix, name string) (*mgo.GridFile, error)
- func (m *MgoDB) GridFSFindAll(prefix string, query, result interface{}) error
- func (m *MgoDB) GridFSFindOne(prefix string, query, result interface{}) error
- func (m *MgoDB) GridFSOpen(prefix, name string) (*mgo.GridFile, error)
- func (m *MgoDB) GridFSRemove(prefix, name string) error
- func (m *MgoDB) Insert(docs ...interface{}) error
- func (m *MgoDB) IsEmpty() bool
- func (m *MgoDB) IsLive() bool
- func (m *MgoDB) PipeAll(pipeline, result interface{}, allowDiskUse bool) error
- func (m *MgoDB) PipeIter(pipeline interface{}, allowDiskUse bool) (*mgo.Iter, error)
- func (m *MgoDB) PipeOne(pipeline, result interface{}, allowDiskUse bool) error
- func (m *MgoDB) Remove(selector interface{}) error
- func (m *MgoDB) RemoveAll(selector interface{}) error
- func (m *MgoDB) RemoveRepeat(selector interface{})
- func (m *MgoDB) RemoveRepeatByKey(key string)
- func (m *MgoDB) SetCollection(name string)
- func (m *MgoDB) SetName(name string)
- func (m *MgoDB) Update(selector, update interface{}) error
- func (m *MgoDB) UpdateAll(selector, update interface{}) error
- func (m *MgoDB) Upsert(selector, update interface{}) error
Constants ¶
View Source
const (
PoolLimit = 4096
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MgoDB ¶
type MgoDB struct {
CurrentDBname string
CurrentDBcollection string
// contains filtered or unexported fields
}
mgo object 储存数据库访问的上下文
func (*MgoDB) BulkInsert ¶
func (m *MgoDB) BulkInsert(docs ...interface{}) (*mgo.BulkResult, error)
insert one or multi documents
func (*MgoDB) BulkRemove ¶
func (m *MgoDB) BulkRemove(selector ...interface{}) (*mgo.BulkResult, error)
func (*MgoDB) BulkRemoveAll ¶
func (m *MgoDB) BulkRemoveAll(selector ...interface{}) (*mgo.BulkResult, error)
func (*MgoDB) BulkUpdate ¶
func (m *MgoDB) BulkUpdate(pairs ...interface{}) (*mgo.BulkResult, error)
func (*MgoDB) BulkUpdateAll ¶
func (m *MgoDB) BulkUpdateAll(pairs ...interface{}) (*mgo.BulkResult, error)
func (*MgoDB) BulkUpsert ¶
func (m *MgoDB) BulkUpsert(pairs ...interface{}) (*mgo.BulkResult, error)
func (*MgoDB) FindPageReverse ¶
func (*MgoDB) GridFSCreate ¶
func (*MgoDB) GridFSFindAll ¶
func (*MgoDB) GridFSFindOne ¶
func (*MgoDB) GridFSRemove ¶
func (*MgoDB) RemoveRepeat ¶
func (m *MgoDB) RemoveRepeat(selector interface{})
func (*MgoDB) RemoveRepeatByKey ¶
func (*MgoDB) SetCollection ¶
change db context collection name 修改数据库名称,除特殊不建议使用
Click to show internal directories.
Click to hide internal directories.