Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created August 23, 2019 11:13
Show Gist options
  • Save brunokrebs/79054ded69fb83940662b77d48d64193 to your computer and use it in GitHub Desktop.
Save brunokrebs/79054ded69fb83940662b77d48d64193 to your computer and use it in GitHub Desktop.
const { MongoMemoryServer } = require('mongodb-memory-server');
async function connect() {
const mongoConnection = new MongoMemoryServer({ debug: true });
const status = mongoConnection.getInstanceInfo();
console.log(status);
const connectionString = await mongoConnection.getConnectionString();
console.log('=================================================================================');
console.log(connectionString);
console.log('=================================================================================');
}
try {
connect().then(() => {
console.log('done');
});
} catch (e) {
console.error(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment