From c34e8e91b56a9b96f5322f52cb425857f7e6b6ee Mon Sep 17 00:00:00 2001 From: Devin Deng Date: Sun, 6 Nov 2022 17:10:15 -0800 Subject: [PATCH] set db --- lib/getMongoDBClient.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/getMongoDBClient.ts b/lib/getMongoDBClient.ts index c1151f5..f72b04b 100644 --- a/lib/getMongoDBClient.ts +++ b/lib/getMongoDBClient.ts @@ -18,5 +18,7 @@ export const getMongoDBClient = async () => { const client = new MongoClient(URI); await client.connect(); - return client.db(DATABASENAME); + db = client.db(DATABASENAME); + + return db; }