another test

This commit is contained in:
mr 2024-07-22 14:06:53 +02:00
parent 9f17532646
commit b1c3c056df

View File

@ -170,13 +170,13 @@ func (m *MongoDB) StoreOne(obj interface{}, id string, collection_name string) (
MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second) MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
defer cancel() defer cancel()
result, err := targetDBCollection.InsertOne(MngoCtx, doc) _, err := targetDBCollection.InsertOne(MngoCtx, doc)
if err != nil { if err != nil {
m.Logger.Error().Msg("Couldn't insert resource: " + err.Error()) m.Logger.Error().Msg("Couldn't insert resource: " + err.Error())
return "", 409, err return "", 409, err
} }
return result.InsertedID.(primitive.ObjectID).Hex(), 200, nil return id, 200, nil
} }
func (m *MongoDB) LoadOne(id string, collection_name string) (*mongo.SingleResult, int, error) { func (m *MongoDB) LoadOne(id string, collection_name string) (*mongo.SingleResult, int, error) {