Skip to content

Commit

Permalink
Resolves warnings in Mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
CGoodwin90 committed Nov 8, 2023
1 parent 0dbfc2c commit 974cfa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 974cfa2

Please sign in to comment.