Documentation
¶
Index ¶
- func ExpressionToBSON(criteria expression.Expression) bson.M
- type Collection
- func (c Collection) Delete(object data.Object, note string) *derp.Error
- func (c Collection) List(criteria expression.Expression, options ...option.Option) (data.Iterator, *derp.Error)
- func (c Collection) Load(criteria expression.Expression, target data.Object) *derp.Error
- func (c Collection) Save(object data.Object, note string) *derp.Error
- type Iterator
- type Server
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpressionToBSON ¶ added in v0.2.0
func ExpressionToBSON(criteria expression.Expression) bson.M
ExpressionToBSON converts a data.Expression value into pure bson.
Types ¶
type Collection ¶ added in v0.3.8
type Collection struct {
// contains filtered or unexported fields
}
Collection wraps a mongodb.Collection with all of the methods required by the data.Collection interface
func (Collection) Delete ¶ added in v0.3.8
Delete removes a single object from the database, using a "virtual delete"
func (Collection) List ¶ added in v0.3.8
func (c Collection) List(criteria expression.Expression, options ...option.Option) (data.Iterator, *derp.Error)
List retrieves a group of objects from the database
func (Collection) Load ¶ added in v0.3.8
func (c Collection) Load(criteria expression.Expression, target data.Object) *derp.Error
Load retrieves a single object from the database
type Iterator ¶ added in v0.2.5
Iterator wraps the mongodb Cursor object
func NewIterator ¶ added in v0.2.5
NewIterator returns a fully populated Iterator object
type Server ¶ added in v0.3.6
Server is an abstract representation of a MongoDB database. It implements the data.Server interface, so that it should be usable anywhere that requires a data.Server.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a single database session, such as a session encompassing all of the database queries to respond to a single REST service call.
func (Session) Close ¶
func (s Session) Close()
Close cleans up any remaining connections that need to be removed.
func (Session) Collection ¶ added in v0.3.8
func (s Session) Collection(collection string) data.Collection
Collection returns a reference to an individual database collection.