This commit is contained in:
mr 2024-07-22 16:57:54 +02:00
parent e44a6b65b7
commit a6f2556050

View File

@ -3,6 +3,7 @@ package mongo
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"time" "time"
"cloud.o-forge.io/core/oc-lib/dbs" "cloud.o-forge.io/core/oc-lib/dbs"
@ -153,7 +154,7 @@ func (m *MongoDB) UpdateOne(set interface{}, id string, collection_name string)
targetDBCollection := CollectionMap[collection_name] targetDBCollection := CollectionMap[collection_name]
MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second) MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
defer cancel() defer cancel()
fmt.Println(doc)
_, err := targetDBCollection.UpdateOne(MngoCtx, filter, dbs.InputToBson(doc, true)) _, err := targetDBCollection.UpdateOne(MngoCtx, filter, dbs.InputToBson(doc, true))
if err != nil { if err != nil {
m.Logger.Error().Msg("Couldn't update resource: " + err.Error()) m.Logger.Error().Msg("Couldn't update resource: " + err.Error())