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 (
"context"
"errors"
"fmt"
"time"
"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]
MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
fmt.Println(doc)
_, err := targetDBCollection.UpdateOne(MngoCtx, filter, dbs.InputToBson(doc, true))
if err != nil {
m.Logger.Error().Msg("Couldn't update resource: " + err.Error())