From ba6cb2b4a70cd8b3831e3e1ae7268fa677eddc39 Mon Sep 17 00:00:00 2001 From: Evan Bailey Date: Thu, 25 Jul 2024 22:59:00 -0700 Subject: [PATCH] Check access to users db on load --- server/dbconnection.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/dbconnection.ts b/server/dbconnection.ts index 479b693c..50569b3a 100644 --- a/server/dbconnection.ts +++ b/server/dbconnection.ts @@ -19,6 +19,9 @@ export const initialize = async (connectionString: string): Promise => { await mongoClient.connect(); const db = mongoClient.db(); await db.command({ ping: 1 }); + const users = db.collection("users"); + // Ensure we can read from users + await users.findOne(); console.log("Connected successfully to database."); return; };