Skip to content

Commit

Permalink
chore: rename all suhu collection to dukun
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Nov 6, 2023
1 parent 396a1e6 commit e2d9ed9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions analytics/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func Cleanup() {
log.Fatal(err)
}

collection := dependency.Mongo.Database(dependency.MongoDBName).Collection("suhu")
collection := dependency.Mongo.Database(dependency.MongoDBName).Collection("dukun")
err = collection.Drop(ctx)
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -346,7 +346,7 @@ func Seed(ctx context.Context) error {
}

// Feed some dukun
collection := dependency.Mongo.Database(dependency.MongoDBName).Collection("suhu")
collection := dependency.Mongo.Database(dependency.MongoDBName).Collection("dukun")
_, err = collection.InsertOne(ctx, dukun.Dukun{
UserID: 1,
FirstName: "Jason",
Expand Down
4 changes: 2 additions & 2 deletions dukun/dukun.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
// createdAt: Date,
// updatedAt: Date
// },
// { collection: "suhu" }
// { collection: "dukun" }
// );

type Dependency struct {
Expand All @@ -42,7 +42,7 @@ type Dukun struct {
}

func (d *Dependency) GetAllDukun(ctx context.Context) ([]Dukun, error) {
collection := d.Mongo.Database(d.DBName).Collection("suhu")
collection := d.Mongo.Database(d.DBName).Collection("dukun")
cols, err := collection.Find(ctx, bson.D{{}})
if err != nil {
return []Dukun{}, err
Expand Down
4 changes: 2 additions & 2 deletions dukun/dukun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestMain(m *testing.M) {
cleanupCtx, cleanupCancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cleanupCancel()

collection := db.Database(dependency.DBName).Collection("suhu")
collection := db.Database(dependency.DBName).Collection("dukun")
err = collection.Drop(cleanupCtx)
if err != nil {
log.Fatal(err)
Expand All @@ -73,7 +73,7 @@ func seed() error {
defer cancel()

// Feed some dukun
collection := dependency.Mongo.Database(dependency.DBName).Collection("suhu")
collection := dependency.Mongo.Database(dependency.DBName).Collection("dukun")
_, err := collection.InsertOne(ctx, dukun.Dukun{
UserID: 1,
FirstName: "Jason",
Expand Down

0 comments on commit e2d9ed9

Please sign in to comment.