Documentation ¶
Index ¶
- Variables
- func ObjectIdHex(s string) bson.ObjectId
- type Dbm
- func (self *Dbm) Delete(collectionName, id string, doc interface{}) error
- func (self *Dbm) DeleteAll(collectionName string, selector interface{}) (*mgo.ChangeInfo, error)
- func (self *Dbm) Find(collectionName string, query interface{}) *mgo.Query
- func (self *Dbm) GetCollection(collectionName string) *mgo.Collection
- func (self *Dbm) GetInstance() *Dbm
- func (self *Dbm) Init(connectUrl string, dbName string, timeout time.Duration) error
- func (self *Dbm) Insert(collectionName string, doc interface{}) error
- func (self *Dbm) InsertAll(collectionName string, docs ...interface{}) error
- func (self *Dbm) Update(collectionName, id string, doc interface{}) error
- func (self *Dbm) UpdateAll(collectionName string, selector interface{}, change interface{}) (*mgo.ChangeInfo, error)
- type Model
- func (self *Model) Count(queryDoc interface{}) (n int, err error)
- func (self *Model) Delete() (err error)
- func (self *Model) Find(query interface{}) (*mgo.Query, error)
- func (self *Model) FindAll(query Query, docs interface{}) (err error)
- func (self *Model) FindByPk(id string, doc interface{}) (err error)
- func (self *Model) FindOne(queryDoc interface{}, doc interface{}) (err error)
- func (self *Model) MergeDoc(docOld interface{}, docNew interface{}) error
- func (self *Model) ReloadDoc(doc interface{})
- func (self *Model) Save() (err error)
- func (self *Model) SetDoc(doc interface{})
- type Query
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DbmInstance *Dbm Debug bool )
View Source
var ( SortedDesc string = "-" SortedAsk string = "" )
Functions ¶
func ObjectIdHex ¶
Types ¶
type Dbm ¶
type Dbm struct {
Database *mgo.Database
}
func (*Dbm) GetCollection ¶
func (*Dbm) GetInstance ¶
type Model ¶
type Model struct { //Crutch for success encoding gob Tmp *bool `bson:"-" json:"-" xml:"-"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.