Versions in this module Expand all Collapse all v2 v2.0.0 Apr 15, 2026 Changes in this version + func Count(ctx context.Context, collectionName string, query bson.M) (int, error) + func CountUnscoped(ctx context.Context, collectionName string, query bson.M) (int, error) + func Create(ctx context.Context, collectionName string, doc document) error + func Destroy(ctx context.Context, collectionName string, doc destroyable) error + func EnsureParanoidIndices(ctx context.Context, collectionNames ...string) + func Find(ctx context.Context, collectionName string, id bson.ObjectId, doc scopable, ...) error + func FindOne(ctx context.Context, collectionName string, query bson.M, doc scopable, ...) error + func FindOneUnscoped(ctx context.Context, collectionName string, query bson.M, doc interface{}) error + func FindUnscoped(ctx context.Context, collectionName string, id bson.ObjectId, doc interface{}, ...) error + func ReallyDestroy(ctx context.Context, collectionName string, doc document) error + func Restore(ctx context.Context, collectionName string, doc document) error + func Save(ctx context.Context, collectionName string, doc document) error + func Update(ctx context.Context, collectionName string, update bson.M, doc document) error + func Where(ctx context.Context, collectionName string, query bson.M, data interface{}, ...) error + func WhereIter(ctx context.Context, collectionName string, query bson.M, ...) error + func WhereIterUnscoped(ctx context.Context, collectionName string, query bson.M, ...) error + func WhereUnscoped(ctx context.Context, collectionName string, query bson.M, data interface{}, ...) error + type Base struct + CreatedAt time.Time + ID bson.ObjectId + UpdatedAt time.Time + func (d *Base) Validate(_ context.Context) error + func (d Base) IsPersisted() bool + type Closer interface + Close func() + func WhereQuery(ctx context.Context, collectionName string, query bson.M, ...) (*mgo.Query, Closer) + func WhereUnscopedQuery(ctx context.Context, collectionName string, query bson.M, ...) (*mgo.Query, Closer) + type Paranoid struct + DeletedAt *time.Time + func (p Paranoid) IsDeleted() bool + type SortField string + type Validable interface + Validate func(ctx context.Context) error Other modules containing this package github.com/Scalingo/go-utils github.com/Scalingo/go-utils/mongo