console.log(`\n✅ Connected to MongoDB: ${conn.connection.host}`);
// Find users with the role 'admin'
constadmins=awaitUser.find({role:'admin'}).select('-password');// Exclude password from logs
if(admins.length>0){
console.log(`\n🎉 Found ${admins.length} Admin User(s) in the database:\n`);
console.log(admins);
}else{
console.log('\n❌ No admin users found in the database. When the server starts up, it should automatically create admin@test.com if it doesn\'t exist.');
}
process.exit(0);
}catch(error){
console.error('\n❌ Error connecting to database or checking admins:');