Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingResumeToken = mongo.ErrMissingResumeToken ErrNilCursor = mongo.ErrNilCursor ErrUnacknowledgedWrite = mongo.ErrUnacknowledgedWrite ErrClientDisconnected = mongo.ErrClientDisconnected ErrNilDocument = mongo.ErrNilDocument ErrEmptySlice = mongo.ErrEmptySlice ErrInvalidIndexValue = mongo.ErrInvalidIndexValue ErrNonStringIndexName = mongo.ErrNonStringIndexName ErrMultipleIndexDrop = mongo.ErrMultipleIndexDrop ErrWrongClient = mongo.ErrWrongClient ErrNoDocuments = mongo.ErrNoDocuments )
Reexported mongo errors
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { Client() (client *Client) Context() (context context.Context) Name() (name string) New(ctx context.Context) (db Database) GetCollectionOf(document interface{}) (collection *Collection) Count(target interface{}, filters ...interface{}) (count int64, err error) DeleteArray(target interface{}, filters ...interface{}) (err error) DeleteOne(target interface{}, filters ...interface{}) (err error) LoadArray(target interface{}, filters ...interface{}) (err error) LoadOne(target interface{}, filters ...interface{}) (err error) LoadStream(target interface{}, filters ...interface{}) (loader StreamLoader, err error) SaveOne(source interface{}, filters ...interface{}) (err error) UpdateOne(target interface{}, filters ...interface{}) (err error) IndexEnsure(cfg interface{}, document interface{}) (err error) }
Database is the mongox database interface
type InterfaceBased ¶
type InterfaceBased interface { GetID() (id interface{}) SetID(id interface{}) }
InterfaceBased is an interface for documents that have custom declated type for the _id field
type StreamLoader ¶
type StreamLoader interface { Cursor() (cursor *Cursor) DecodeNextMsg(i interface{}) (err error) DecodeMsg(i interface{}) (err error) Next() (err error) Close() (err error) Err() (err error) }
StreamLoader is a interface to control database cursor
type StringBased ¶
StringBased is an interface for documents that have string type for the _id field
Click to show internal directories.
Click to hide internal directories.