Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExists = errors.New("element already exists")
View Source
var ErrNotFound = errors.New("element not found in collection")
Functions ¶
func SetOrdered ¶
Types ¶
type Collection ¶
type Collection string
type Database ¶
type Database interface { FindOne(coll Collection, filter interface{}, res interface{}) error FindOneById(coll Collection, id string, res interface{}) error FindOneSorted(coll Collection, filter bson.M, sort bson.M, res interface{}) error FindMany(coll Collection, filter bson.M, each func(c Decodable) error) error FindManyWithOptions(coll Collection, filter bson.M, each func(c Decodable) error, sort bson.M, limit int) error ListPaginated(coll Collection, perPage int, page int, p *sdk.Pagination, each func(c Decodable) error) error UpdateProvided(coll Collection, provider string, updates map[string]interface{}) error UpdateMany(coll Collection, filters map[string]interface{}, updates map[string]interface{}) error UpdateOne(coll Collection, filter bson.M, createIfMissing bool, update interface{}, res interface{}) error UpdateOneById(coll Collection, id string, createIfMissing bool, update interface{}, res interface{}) error InsertOne(coll Collection, existsFilter interface{}, data interface{}) error DeleteOne(coll Collection, filter bson.M) error DeleteOneById(coll Collection, id string) error EnsureIndex(coll Collection, model mongo.IndexModel) error }
func NewMongoDB ¶
func NewMongoDB(l MongoLogin) (Database, error)
type DecodableFunc ¶
type DecodableFunc func(target interface{}) error
func (DecodableFunc) Decode ¶
func (f DecodableFunc) Decode(dec interface{}) error
type ErrMongoQueryFailed ¶
type ErrMongoQueryFailed struct {
Err error
}
func (*ErrMongoQueryFailed) Error ¶
func (r *ErrMongoQueryFailed) Error() string
func (*ErrMongoQueryFailed) Is ¶
func (r *ErrMongoQueryFailed) Is(target error) bool
func (*ErrMongoQueryFailed) Unwrap ¶
func (r *ErrMongoQueryFailed) Unwrap() error
type MongoLogin ¶
Click to show internal directories.
Click to hide internal directories.