Skip to content

Commit

Permalink
fix: remove explicit db name from client function
Browse files Browse the repository at this point in the history
  • Loading branch information
makelicious committed Jan 15, 2025
1 parent e3ecd99 commit 9aace78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/events/src/storage/mongodb/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ const client = new MongoClient(url)
export async function getClient() {
await client.connect()

return client.db('events')
// Providing the database name is not necessary, it will read it from the connection string.
// e2e-environment uses different name from deployment to deployment, so we can't hardcode it.
return client.db()
}
4 changes: 3 additions & 1 deletion packages/events/src/storage/mongodb/user-mgnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ const client = new MongoClient(url)
export async function getClient() {
await client.connect()

return client.db('user-mgnt')
// Providing the database name is not necessary, it will read it from the connection string.
// e2e-environment uses different name from deployment to deployment, so we can't hardcode it.
return client.db()
}

0 comments on commit 9aace78

Please sign in to comment.