Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcMongoUri ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) GetCollection ¶
func (m *DB) GetCollection(n string) *mongo.Collection
type EntityCreator ¶
type EntityCreator[Entity any] func() *Entity
type EntityTransformer ¶
type Helper ¶
type Helper[Entity any, Transform any] interface { GetFilterCount(ctx context.Context, filter bson.M, options ...*options.CountOptions) (int64, error) GetListFilter(ctx context.Context, filter bson.M, options ...*options.FindOptions) ([]Entity, error) GetListFilterTransform(ctx context.Context, filter bson.M, transform EntityTransformer[Entity, Transform], options ...*options.FindOptions) ([]Transform, error) GetAggregateListFilter(ctx context.Context, pipeline mongo.Pipeline, options ...*options.AggregateOptions) ([]Entity, error) GetAggregateListFilterTransform(ctx context.Context, pipeline mongo.Pipeline, transform EntityTransformer[Entity, Transform], options ...*options.AggregateOptions) ([]Transform, error) GetFilter(ctx context.Context, filter bson.M, options ...*options.FindOneOptions) (*Entity, bool, error) UpdateOne(ctx context.Context, filter bson.M, setter bson.M, options ...*options.UpdateOptions) error }
func NewHelper ¶
func NewHelper[Entity any, Transform any](collection *mongo.Collection, creator EntityCreator[Entity]) Helper[Entity, Transform]
Click to show internal directories.
Click to hide internal directories.