Created
July 28, 2022 21:29
-
-
Save parkerfoshay/02aebc58b0bfd8220709e33c4ce286bb to your computer and use it in GitHub Desktop.
C#-connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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