Documentation ¶
Index ¶
- func AlterDoc(doc *utils.M, operator string, operation utils.M)
- func Convert(doc utils.M, out interface{})
- func InArray(key string, arrays ...[]string) bool
- type BaseInterface
- type BaseModel
- type MConn
- func (self *MConn) Aggregate(session *mgo.Session, table string, doc []utils.M) *mgo.Pipe
- func (self *MConn) Count(table string, query utils.M) int
- func (self *MConn) Delete(table string, query utils.M) error
- func (self *MConn) DropIndex(table string, key ...string) error
- func (self *MConn) DropIndices(table string) error
- func (self *MConn) EnsureIndex(table string, index mgo.Index) error
- func (self *MConn) FindAndUpdate(table string, query utils.M, doc utils.M, result interface{}) error
- func (self *MConn) FindAndUpsert(table string, query utils.M, doc utils.M, result interface{}) error
- func (self *MConn) Get(session *mgo.Session, table string, query utils.M) *mgo.Iter
- func (self *MConn) GetCursor(session *mgo.Session, table string, query utils.M) *mgo.Query
- func (self *MConn) GetOne(table string, query utils.M, result interface{}) error
- func (self *MConn) HintedCount(table string, query utils.M, hint string) int
- func (self *MConn) HintedGetOne(table string, query utils.M, result interface{}, hint string) error
- func (self *MConn) Insert(table string, arguments ...interface{}) (_id string)
- func (self *MConn) MapReduce(session *mgo.Session, table string, query utils.M, result interface{}, ...) (*mgo.MapReduceInfo, error)
- func (self *MConn) Update(table string, query utils.M, doc utils.M) error
- func (self *MConn) Upsert(table string, query utils.M, doc utils.M) error
- type MapReduce
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseInterface ¶
type BaseInterface interface {
PrepareSave()
}
type BaseModel ¶
type BaseModel struct { Id bson.ObjectId `json:"_id,omitempty" bson:"_id" required:"true"` CreatedOn int64 `json:"created_on" bson:"created_on" required:"true"` ModifiedOn int64 `json:"updated_on" bson:"updated_on" required:"true"` }
func (*BaseModel) PrepareSave ¶
func (self *BaseModel) PrepareSave()
type MConn ¶
type MConn struct { Session *mgo.Session Dbname string }
var Conn *MConn
func (*MConn) DropIndices ¶
func (*MConn) EnsureIndex ¶
func (*MConn) FindAndUpdate ¶
func (*MConn) FindAndUpsert ¶
func (*MConn) HintedCount ¶
func (*MConn) HintedGetOne ¶
Click to show internal directories.
Click to hide internal directories.