Skip to content

Instantly share code, notes, and snippets.

@nelreina
Last active April 28, 2019 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelreina/1d75fb76d285d714f614966afa8b6c9a to your computer and use it in GitHub Desktop.
Save nelreina/1d75fb76d285d714f614966afa8b6c9a to your computer and use it in GitHub Desktop.
const {MongoClient} = require( "mongodb");
(async () => {
const client = new MongoClient();
const url = 'mongodb://localhost:27017/test';
const db = await client.connect(url);
console.log(await db.admin().listDatabases());
await db.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment