📅  最后修改于: 2022-03-11 14:49:15.209000             🧑  作者: Mango
MongoClient dbClient = new MongoClient(<>);
var dbList = dbClient.ListDatabases().ToList();
Console.WriteLine("The list of databases on this server is: ");
foreach (var db in dbList)
{
Console.WriteLine(db);
}