Skip to content

Commit

Permalink
db index setup shall also have credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab committed Jul 11, 2024
1 parent 550c314 commit 549ecbc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/db/model/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ var collections = map[string][]index{
}

func Setup(ctx context.Context, cfg *config.Config) error {
clientOps := options.Client().ApplyURI(cfg.Db.Address)
credential := options.Credential{
Username: cfg.Db.Username,
Password: cfg.Db.Password,
}
clientOps := options.Client().ApplyURI(cfg.Db.Address).SetAuth(credential)
client, err := mongo.Connect(ctx, clientOps)
if err != nil {
return err
Expand Down

0 comments on commit 549ecbc

Please sign in to comment.