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, *i18np.Error) GetListFilter(ctx context.Context, filter bson.M, options ...*options.FindOptions) ([]Entity, *i18np.Error) GetListFilterTransform(ctx context.Context, filter bson.M, transform EntityTransformer[Entity, Transform], options ...*options.FindOptions) ([]Transform, *i18np.Error) GetAggregateListFilter(ctx context.Context, pipeline mongo.Pipeline, options ...*options.AggregateOptions) ([]Entity, *i18np.Error) GetAggregateListFilterTransform(ctx context.Context, pipeline mongo.Pipeline, transform EntityTransformer[Entity, Transform], options ...*options.AggregateOptions) ([]Transform, *i18np.Error) GetFilter(ctx context.Context, filter bson.M, options ...*options.FindOneOptions) (*Entity, bool, *i18np.Error) UpdateOne(ctx context.Context, filter bson.M, setter bson.M, options ...*options.UpdateOptions) *i18np.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.