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

@@ -3,7 +3,7 @@ package storable
import (
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/v2/bson"
)
const (
@@ -15,16 +15,16 @@ const (
)
type Base struct {
ID primitive.ObjectID `bson:"_id" json:"id"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"` // Timestamp for when the comment was created
UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` // Timestamp for when the comment was last updated (optional)
ID bson.ObjectID `bson:"_id" json:"id"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"` // Timestamp for when the comment was created
UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` // Timestamp for when the comment was last updated (optional)
}
func (b *Base) GetID() *primitive.ObjectID {
func (b *Base) GetID() *bson.ObjectID {
return &b.ID
}
func (b *Base) SetID(objID primitive.ObjectID) {
func (b *Base) SetID(objID bson.ObjectID) {
b.ID = objID
b.CreatedAt = time.Now()
b.UpdatedAt = time.Now()

View File

@@ -1,11 +1,11 @@
package storable
import "go.mongodb.org/mongo-driver/bson/primitive"
import "go.mongodb.org/mongo-driver/v2/bson"
const (
RefField = "ref"
)
type Ref struct {
Ref primitive.ObjectID `bson:"ref" json:"ref"`
Ref bson.ObjectID `bson:"ref" json:"ref"`
}

View File

@@ -1,10 +1,10 @@
package storable
import "go.mongodb.org/mongo-driver/bson/primitive"
import "go.mongodb.org/mongo-driver/v2/bson"
type Storable interface {
GetID() *primitive.ObjectID
SetID(objID primitive.ObjectID)
GetID() *bson.ObjectID
SetID(objID bson.ObjectID)
Update()
Collection() string
}