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
This commit is contained in:
parent
ad9224b761
commit
1f18ad001d
1 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue