another test
This commit is contained in:
parent
9f17532646
commit
b1c3c056df
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user