Documentation ¶
Index ¶
- Constants
- Variables
- type DbCfg
- type DbOperate
- func (this *DbOperate) BulkInsert(collection string, pairs []bson.M) error
- func (this *DbOperate) BulkInsertDoc(collection string, docs []interface{}) error
- func (this *DbOperate) BulkUpdate(collection string, pairs []bson.M) error
- func (this *DbOperate) BulkUpsert(collection string, pairs []bson.M) error
- func (this *DbOperate) CloseDB()
- func (this *DbOperate) Cover(collection string, cond interface{}, change interface{}) error
- func (this *DbOperate) CreateGridFile(collection string, filename string, resHandler func(*mgo.GridFile) error) error
- func (this *DbOperate) DBFindAll(collection string, cond interface{}, resHandler func(bson.M) error) error
- func (this *DbOperate) DBFindAllEx(collection string, cond interface{}, resHandler func(*mgo.Query) error) error
- func (this *DbOperate) DBFindOne(collection string, cond interface{}, resHandler func(bson.M) error) error
- func (this *DbOperate) DeleteAll(collection string, cond interface{}) (int, error)
- func (this *DbOperate) DeleteOne(collection string, cond interface{}) error
- func (this *DbOperate) FindAll(collection string, cond interface{}, all interface{}) error
- func (this *DbOperate) FindAndModify(collection string, cond interface{}, change mgo.Change, val interface{}) error
- func (this *DbOperate) FindOne(collection string, cond interface{}, value interface{}) error
- func (db *DbOperate) GetDbSession() *mgo.Session
- func (this *DbOperate) GetMaxId(collection string, field string) (int64, error)
- func (this *DbOperate) GridFileExists(collection string, filename string) (bool, error)
- func (this *DbOperate) Insert(collection string, doc interface{}) error
- func (this *DbOperate) OpenDB(set_index_func func(ms *mgo.Session)) error
- func (this *DbOperate) OpenGridFile(collection string, filename string) ([]byte, error)
- func (this *DbOperate) RefreshSession()
- func (this *DbOperate) RemoveAll(collection string, cond interface{}) error
- func (this *DbOperate) RemoveGridFile(collection string, filename string) (bool, error)
- func (this *DbOperate) RemoveOne(collection string, cond_name string, cond_value int64) error
- func (this *DbOperate) RemoveOneByCond(collection string, cond interface{}) error
- func (this *DbOperate) SetMode(mode int, refresh bool)
- func (this *DbOperate) StrongBatchInsert(collection string, docs ...interface{}) error
- func (this *DbOperate) StrongDBFindAll(collection string, cond interface{}, resHandler func(bson.M) error) error
- func (this *DbOperate) StrongDBFindAllEx(collection string, cond interface{}, resHandler func(*mgo.Query) error) error
- func (this *DbOperate) StrongDBFindOne(collection string, cond interface{}, resHandler func(bson.M) error) error
- func (this *DbOperate) StrongInsert(collection string, doc interface{}) error
- func (this *DbOperate) StrongUpdate(collection string, cond interface{}, change interface{}) error
- func (this *DbOperate) StrongUpdateInsert(collection string, cond interface{}, doc interface{}) error
- func (this *DbOperate) Update(collection string, cond interface{}, change interface{}) error
- func (this *DbOperate) UpdateInsert(collection string, cond interface{}, doc interface{}) error
- func (this *DbOperate) WriteGridFile(collection string, filename string, data []byte) error
Constants ¶
View Source
const ( Strong = 1 Monotonic = 2 )
Variables ¶
View Source
var ( XINGO_MONGODB_SESSION_NIL_ERR = errors.New("DbOperate session nil.") XINGO_MONGODB_NOTFOUND_ERR = errors.New("not found!") XINGO_MONGODB_DBFINDALL_ERR = errors.New("DBFindAll failed,q is nil!") XINGO_MONGODB_OPENGRIDFILE_ERR = errors.New("OpenGridFile failed!") XINGO_MONGODB_READGRIDFILE_ERR = errors.New("ReadGridFile failed!") XINGO_MONGODB_CREATEGRIDFILE_ERR = errors.New("CreateGridFile is nil") )
Functions ¶
This section is empty.
Types ¶
type DbOperate ¶
type DbOperate struct {
// contains filtered or unexported fields
}
func (*DbOperate) BulkInsert ¶
func (*DbOperate) BulkInsertDoc ¶
func (*DbOperate) BulkUpdate ¶
func (*DbOperate) BulkUpsert ¶
func (*DbOperate) CreateGridFile ¶
func (*DbOperate) DBFindAllEx ¶
func (*DbOperate) FindAndModify ¶
func (*DbOperate) GetDbSession ¶
func (db *DbOperate) GetDbSession() *mgo.Session
func (*DbOperate) GridFileExists ¶
func (*DbOperate) OpenGridFile ¶
gridfs
func (*DbOperate) RefreshSession ¶
func (this *DbOperate) RefreshSession()
func (*DbOperate) RemoveGridFile ¶
func (*DbOperate) RemoveOneByCond ¶
func (*DbOperate) StrongBatchInsert ¶
func (*DbOperate) StrongDBFindAll ¶
func (*DbOperate) StrongDBFindAllEx ¶
func (*DbOperate) StrongDBFindOne ¶
func (*DbOperate) StrongInsert ¶
func (*DbOperate) StrongUpdate ¶
func (*DbOperate) StrongUpdateInsert ¶
func (*DbOperate) UpdateInsert ¶
Click to show internal directories.
Click to hide internal directories.