diff --git a/dbs/mongo/mongo.go b/dbs/mongo/mongo.go index 479d005..1164450 100644 --- a/dbs/mongo/mongo.go +++ b/dbs/mongo/mongo.go @@ -170,13 +170,13 @@ func (m *MongoDB) StoreOne(obj interface{}, id string, collection_name string) ( MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - result, err := targetDBCollection.InsertOne(MngoCtx, doc) + _, err := targetDBCollection.InsertOne(MngoCtx, doc) if err != nil { m.Logger.Error().Msg("Couldn't insert resource: " + err.Error()) 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) {