Documentation
¶
Overview ¶
Package datastore implements an interface on top of the mgo mongo client
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bulk ¶
type Bulk interface { Upsert(pairs ...interface{}) RemoveAll(selectors ...interface{}) Run() (*mgo.BulkResult, error) }
Bulk is an interface for running Bulk queries on a MongoDB collection
type Collection ¶
type Collection interface { Bulk() Bulk Pipe(pipeline interface{}) Pipe Find(query interface{}) Query FindId(id interface{}) Query Count() (n int, err error) Insert(docs ...interface{}) error Remove(selector interface{}) error RemoveAll(selector interface{}) (*mgo.ChangeInfo, error) UpdateId(id, update interface{}) error Upsert(selector, update interface{}) (*mgo.ChangeInfo, error) UpsertId(id, update interface{}) (*mgo.ChangeInfo, error) DropCollection() error EnsureIndex(index mgo.Index) error }
Collection is an interface for accessing a MongoDB collection
type Config ¶
type Config struct { URL string Database string Username string Password string Timeout time.Duration }
Config configures the database connection
type Database ¶
type Database interface {
C(name string) Collection
}
Database is an interface for accessing a MongoDB database
Click to show internal directories.
Click to hide internal directories.