From fb4502bb68da849cb1dfa5c4bc179795af282911 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 14 Feb 2021 19:01:38 +0100 Subject: [PATCH] switch to mongoose --- src/Server.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Server.ts b/src/Server.ts index 3bd10928..302aea81 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -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 { - await db.init(); + // @ts-ignore + await (db as Promise); await this.setupSchema(); await Config.init(); console.log("listening");