From 977ff77d503492cfc2965dc6f91a6c907f347eed Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 22 Nov 2024 20:53:21 +0000 Subject: [PATCH] Update PIS to use live db collection --- dbAccess/client.go | 2 +- dbAccess/pis.go | 4 ++-- helpers/config.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbAccess/client.go b/dbAccess/client.go index 56a8aac..6c182aa 100644 --- a/dbAccess/client.go +++ b/dbAccess/client.go @@ -17,7 +17,7 @@ var MongoClient (*mongo.Client) // Builds the DB URI based on the loaded configuration parameters func getDbUri(cfg *helpers.Configuration) string { - var uri = "mongodb://" + cfg.DbUser + ":" + cfg.DbPass + "@" + cfg.DbHost + ":" + cfg.DbPort + var uri = "mongodb://" + cfg.DbUser + ":" + cfg.DbPass + "@" + cfg.DbHost + ":" + cfg.DbPort + "?authSource=owlboard" return uri } diff --git a/dbAccess/pis.go b/dbAccess/pis.go index 21c6c7c..bb81a52 100644 --- a/dbAccess/pis.go +++ b/dbAccess/pis.go @@ -53,7 +53,7 @@ func PutPisMetadata(version string) error { // Puts complete PIS dataset to database func PutPisData(pis *[]database.PIS) (int64, error) { - coll := MongoClient.Database(DatabaseName).Collection("pis_testing") + coll := MongoClient.Database(DatabaseName).Collection(PisCollection) var docs []interface{} for _, entry := range *pis { @@ -69,7 +69,7 @@ func PutPisData(pis *[]database.PIS) (int64, error) { } func CreatePisIndeces() error { - coll := MongoClient.Database(DatabaseName).Collection("pis_testing") + coll := MongoClient.Database(DatabaseName).Collection(PisCollection) crsIndex := mongo.IndexModel{ Keys: bson.D{{"stops", 1}}, diff --git a/helpers/config.go b/helpers/config.go index eb8f8f2..039ea6f 100644 --- a/helpers/config.go +++ b/helpers/config.go @@ -5,7 +5,7 @@ import ( ) // Version Constants -const versionNum string = "2024.11.4" +const versionNum string = "2024.11.5" const versionSuffix string = "" const Version string = versionNum + versionSuffix