Skip to content

Commit c2c09c3

Browse files
author
Amit
committed
restructuring.
1 parent 8edb868 commit c2c09c3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/model/config.go renamed to mongodb_client/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package model
1+
package mongodb_client
22

33
type MongodbConfig struct {
44
Username string

src/mongodb_client/mongodb-client.go renamed to mongodb_client/mongodb-client.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"log"
77
"time"
88

9-
"github.com/amitjangid80/go-mongodb-client/src/model"
109
"go.mongodb.org/mongo-driver/bson"
1110
"go.mongodb.org/mongo-driver/mongo"
1211
"go.mongodb.org/mongo-driver/mongo/options"
@@ -25,7 +24,7 @@ func GetClient() *mongo.Client {
2524
}
2625

2726
// ConnectDB initializes a MongoDB client and returns the database reference.
28-
func ConnectDb(config *model.MongodbConfig) {
27+
func ConnectDb(config *MongodbConfig) {
2928
// Get MongoDB URI from environment variable if set, otherwise use default
3029
mongoDbUrl := fmt.Sprintf("mongodb://%s:%s@%s:%s", config.Username, config.Password, config.Host, config.Port)
3130

@@ -47,8 +46,6 @@ func ConnectDb(config *model.MongodbConfig) {
4746
log.Printf("Connected to MongoDB on port: %s", config.Port)
4847

4948
mongodb = client.Database(config.DbName)
50-
51-
CreateCollections(ctx, config.DbName, "dummy")
5249
}
5350

5451
// Create Collections

0 commit comments

Comments
 (0)