fixed doc env vars + mongo v2 migration

This commit is contained in:
Stephan D
2026-01-31 00:26:42 +01:00
parent cbb7bd8ba6
commit 1aa7e287fb
356 changed files with 1705 additions and 1729 deletions

View File

@@ -9,8 +9,8 @@ import (
ri "github.com/tech/sendico/pkg/db/repository/index"
"github.com/tech/sendico/pkg/db/storable"
"github.com/tech/sendico/pkg/model"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/v2/bson"
"go.mongodb.org/mongo-driver/v2/mongo"
)
type (
@@ -24,18 +24,18 @@ type Repository interface {
Aggregate(ctx context.Context, builder builder.Pipeline, decoder rd.DecodingFunc) error
Insert(ctx context.Context, obj storable.Storable, getFilter builder.Query) error
InsertMany(ctx context.Context, objects []storable.Storable) error
Get(ctx context.Context, id primitive.ObjectID, result storable.Storable) error
Get(ctx context.Context, id bson.ObjectID, result storable.Storable) error
FindOneByFilter(ctx context.Context, builder builder.Query, result storable.Storable) error
FindManyByFilter(ctx context.Context, builder builder.Query, decoder rd.DecodingFunc) error
Update(ctx context.Context, obj storable.Storable) error
// Patch applies partial updates defined by patch to the document identified by id.
Patch(ctx context.Context, id primitive.ObjectID, patch PatchDoc) error
Patch(ctx context.Context, id bson.ObjectID, patch PatchDoc) error
// PatchMany applies partial updates defined by patch to all documents matching filter and returns the number of updated documents.
PatchMany(ctx context.Context, filter FilterQuery, patch PatchDoc) (int, error)
Delete(ctx context.Context, id primitive.ObjectID) error
Delete(ctx context.Context, id bson.ObjectID) error
DeleteMany(ctx context.Context, query builder.Query) error
CreateIndex(def *ri.Definition) error
ListIDs(ctx context.Context, query builder.Query) ([]primitive.ObjectID, error)
ListIDs(ctx context.Context, query builder.Query) ([]bson.ObjectID, error)
ListPermissionBound(ctx context.Context, query builder.Query) ([]model.PermissionBoundStorable, error)
ListAccountBound(ctx context.Context, query builder.Query) ([]model.AccountBoundStorable, error)
Collection() string