From 974cfa278c618e2a46229b123af28142af177b22 Mon Sep 17 00:00:00 2001 From: cgoodwin90 Date: Wed, 8 Nov 2023 14:11:29 +1100 Subject: [PATCH] Resolves warnings in Mongo --- mongo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mongo.go b/mongo.go index 7a04c7a..b2f6776 100644 --- a/mongo.go +++ b/mongo.go @@ -82,7 +82,7 @@ func mongoConnector(connectionString string, database string) string { for _, e := range os.Environ() { pair := strings.SplitN(e, "=", 2) - bsonData := bson.D{{"Key", pair[0]}, {"value", pair[1]}} + bsonData := bson.D{{Key: "Key", Value: pair[0]}, {Key: "value", Value: pair[1]}} environmentVariables = append(environmentVariables, bsonData) if err != nil { log.Print(err) @@ -93,7 +93,7 @@ func mongoConnector(connectionString string, database string) string { if err != nil { log.Print(err) } - filter := bson.D{{"Key", primitive.Regex{Pattern: "LAGOON", Options: ""}}} + filter := bson.D{{Key: "Key", Value: primitive.Regex{Pattern: "LAGOON", Options: ""}}} cursor, _ := envCollection.Find(context.TODO(), filter, options.Find().SetProjection(bson.M{"_id": 0})) var docs []bson.M if err = cursor.All(context.TODO(), &docs); err != nil {