Skip to content

Commit a1c6bd3

Browse files
fix: mongo-backend multi-host URI support (#147)
1 parent 77b1825 commit a1c6bd3

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

packages/backends/mongo/src/mongo-backend.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ export default class MongoBackend implements Backend {
4949
private _connected: boolean;
5050

5151
constructor(mongoUrl: string) {
52-
const url = new URL(mongoUrl);
53-
const dbName = url.pathname && url.pathname !== "/" ? url.pathname.replace(/^\//, "") : "test";
5452
this.client = new MongoClient(mongoUrl, { ignoreUndefined: true });
55-
this.db = this.client.db(dbName);
53+
this.db = this.client.db();
5654
this.jobs = this.db.collection<JobData>("sidequest_jobs");
5755
this.queues = this.db.collection<QueueConfig>("sidequest_queues");
5856
this.counters = this.db.collection("sidequest_counters");

0 commit comments

Comments
 (0)