Skip to content

Instantly share code, notes, and snippets.

@parkerfoshay
Created July 28, 2022 21:29
Show Gist options
  • Save parkerfoshay/02aebc58b0bfd8220709e33c4ce286bb to your computer and use it in GitHub Desktop.
Save parkerfoshay/02aebc58b0bfd8220709e33c4ce286bb to your computer and use it in GitHub Desktop.
C#-connection
using MongoDB.Driver;
var mongoURL = new MongoUrl("");
var client = new MongoClient(mongoURL);
var dbList = client.ListDatabases().ToList();
Console.WriteLine("The list of databases on this server is: ");
foreach (var db in dbList)
{
Console.WriteLine(db);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment