From 1f18ad001dbefce2d0d8e802d3a8d7bdd25793f4 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Sat, 23 Aug 2025 12:22:17 +0100 Subject: [PATCH] Update MongoDB connection logging in db.js - Enhanced connection log to specify 'MongoDB Atlas - Database: faber-finances' - Added comment clarifying that the database is created automatically upon the first document insertion --- server/utils/db.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/utils/db.js b/server/utils/db.js index 30a8462..70bff5a 100644 --- a/server/utils/db.js +++ b/server/utils/db.js @@ -16,8 +16,9 @@ export async function connectToDatabase() { try { client = new MongoClient(uri) await client.connect() + // MongoDB will create the database automatically when first document is inserted db = client.db('faber-finances') - console.log('Connected to MongoDB') + console.log('Connected to MongoDB Atlas - Database: faber-finances') return db } catch (error) { console.error('Failed to connect to MongoDB:', error)