Documentation ¶
Index ¶
- type Collection
- func (c Collection) DeleteOne(ctx context.Context, filter interface{}) (int64, error)
- func (c Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (ICursor, error)
- func (c Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) ISingleResult
- func (c Collection) InsertOne(ctx context.Context, document interface{}) (interface{}, error)
- func (c Collection) UpdateOne(ctx context.Context, filter interface{}, update interface{}) (interface{}, error)
- type Config
- type Cursor
- type DB
- type ICollection
- type ICursor
- type IDB
- type ISingleResult
- type SingleResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (Collection) DeleteOne ¶
func (c Collection) DeleteOne(ctx context.Context, filter interface{}) (int64, error)
func (Collection) Find ¶
func (c Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (ICursor, error)
func (Collection) FindOne ¶
func (c Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) ISingleResult
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (DB) Collection ¶
func (b DB) Collection(name string, opts ...*options.CollectionOptions) ICollection
type ICollection ¶
type ICollection interface { FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) ISingleResult Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (ICursor, error) InsertOne(ctx context.Context, document interface{}) (interface{}, error) UpdateOne(ctx context.Context, filter interface{}, update interface{}) (interface{}, error) DeleteOne(ctx context.Context, filter interface{}) (int64, error) }
type IDB ¶
type IDB interface { Collection(name string, opts ...*options.CollectionOptions) ICollection Close(ctx context.Context) error }
IDB is the interface for a DB connection
type ISingleResult ¶
type ISingleResult interface {
Decode(val interface{}) error
}
type SingleResult ¶
type SingleResult struct {
// contains filtered or unexported fields
}
func (SingleResult) Decode ¶
func (r SingleResult) Decode(val interface{}) error
Click to show internal directories.
Click to hide internal directories.