From adac5e15ccd574a436d85dc8ecbb2b206027d728 Mon Sep 17 00:00:00 2001 From: Akash Mahapatra Date: Fri, 10 Aug 2018 04:42:15 +0530 Subject: [PATCH] Removing error - topology is closed Changed line 73 to fix the connection issue to mongodb --- activity/mongodb/activity.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/activity/mongodb/activity.go b/activity/mongodb/activity.go index 5097df91..a64d6a7e 100644 --- a/activity/mongodb/activity.go +++ b/activity/mongodb/activity.go @@ -70,7 +70,13 @@ func (a *MongoDbActivity) Eval(ctx activity.Context) (done bool, err error) { value := ctx.GetInput(ivData) //todo implement shared sessions - client, err := mongo.NewClient(connectionURI) + // client, err := mongo.NewClient(connectionURI) + /* + The above function was giving below error; + "data not inserted topology is closed" + */ + + client, err := mongo.Connect(context.Background(), connectionURI, nil) if err != nil { activityLog.Errorf("Connection error: %v", err) return false, err