1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

switch to mongoose

This commit is contained in:
Flam3rboy 2021-02-14 19:01:38 +01:00
parent f5269ef39e
commit fb4502bb68

View File

@ -12,11 +12,12 @@ export class Server {
async setupSchema() {
// TODO: adjust expireAfterSeconds -> lower
await db.conn.db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 });
await db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 });
}
async listen(): Promise<void> {
await db.init();
// @ts-ignore
await (db as Promise<Connection>);
await this.setupSchema();
await Config.init();
console.log("listening");