Documentation ¶
Index ¶
- type D
- type DB
- func (db *DB) Connect(dsn string) error
- func (db *DB) ConnectWithTimeout(dsn string, timeout time.Duration) error
- func (db *DB) Count(coll string, query interface{}) (int, error)
- func (db *DB) CreateIndexKey(coll string, key ...string) error
- func (db *DB) CreateIndexKeys(coll string, keys ...string) error
- func (db *DB) Disconnect()
- func (db *DB) Find(coll string, query map[string]interface{}, v interface{}) error
- func (db *DB) FindAll(coll string, v interface{}) error
- func (db *DB) FindByID(coll string, id string, v interface{}) bool
- func (db *DB) FindWithQuery(coll string, query interface{}, v interface{}) error
- func (db *DB) FindWithQueryAll(coll string, query interface{}, v interface{}) error
- func (db *DB) FindWithQueryOne(coll string, query interface{}, v interface{}) error
- func (db *DB) FindWithQuerySortAll(coll string, query interface{}, order string, v interface{}) error
- func (db *DB) FindWithQuerySortLimitAll(coll string, query interface{}, order string, limit int, v interface{}) error
- func (db *DB) FindWithQuerySortLimitOffsetAll(coll string, query interface{}, sort string, limit int, offset int, ...) error
- func (db *DB) FindWithQuerySortLimitOffsetTotalAll(coll string, query interface{}, sort string, limit int, offset int, ...) error
- func (db *DB) FindWithQuerySortOne(coll string, query interface{}, order string, v interface{}) error
- func (db *DB) Insert(coll string, v ...interface{}) error
- func (db *DB) InsertBulk(coll string, v ...interface{}) error
- func (db *DB) InsertSess(coll string, sess *mgo.Session, v ...interface{}) error
- func (db *DB) IsConnected() bool
- func (db *DB) Pipe(coll string, query []bson.M, v interface{}) error
- func (db *DB) PipeOne(coll string, query []bson.M, v interface{}) error
- func (db *DB) Remove(coll string, id interface{}) error
- func (db *DB) RemoveAll(coll string) error
- func (db *DB) RemoveWithIDs(coll string, ids interface{}) error
- func (db *DB) RemoveWithQuery(coll string, query interface{}) error
- func (db *DB) SessClose(sess *mgo.Session)
- func (db *DB) SessCopy() *mgo.Session
- func (db *DB) SessExec(cb func(*mgo.Session))
- func (db *DB) SetMaxTimeMS(d time.Duration)
- func (db *DB) Update(coll string, id interface{}, v interface{}) error
- func (db *DB) UpdateWithQuery(coll string, query interface{}, set interface{}) error
- func (db *DB) UpdateWithQueryAll(coll string, query interface{}, set interface{}) error
- func (db *DB) Upsert(coll string, id interface{}, v interface{}) error
- func (db *DB) UpsertMulti(coll string, id []interface{}, v []interface{}) error
- func (db *DB) UpsertWithQuery(coll string, query interface{}, set interface{}) error
- type M
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB for database
func NewConnection ¶
func (*DB) ConnectWithTimeout ¶
func (*DB) Disconnect ¶
func (db *DB) Disconnect()
func (*DB) FindWithQuery ¶
func (*DB) FindWithQueryAll ¶
func (*DB) FindWithQueryOne ¶
func (*DB) FindWithQuerySortAll ¶
func (*DB) FindWithQuerySortLimitAll ¶
func (*DB) FindWithQuerySortLimitOffsetAll ¶
func (*DB) FindWithQuerySortLimitOffsetTotalAll ¶
func (*DB) FindWithQuerySortOne ¶
func (*DB) InsertBulk ¶
func (*DB) InsertSess ¶
func (*DB) IsConnected ¶
func (*DB) RemoveWithIDs ¶
func (*DB) RemoveWithQuery ¶
func (*DB) SetMaxTimeMS ¶
func (*DB) UpdateWithQuery ¶
func (*DB) UpdateWithQueryAll ¶
func (*DB) UpsertMulti ¶
func (*DB) UpsertWithQuery ¶
Click to show internal directories.
Click to hide internal directories.