#Using a single mongoose connection for multiple client instances

1 messages · Page 1 of 1 (latest)

hollow bobcat

How can I retain the current setup I have for a database without having multiple connections to it due to sharding?

class ExtendedClient extends Discord.Client {
  constructor(options) {
    super(options);
    this.db = mongoose;
  }
  async start() {
    await this.db.connect(config.db);
    await this.login(config.token);
  }
}