@mongodb-helpers/create-url
🎐 .
Simple helper function to generate mongodb url from config object
Installation
# npm
$ npm install @mongodb-helpers/create-url
# yarn
$ yarn add @mongodb-helpers/create-url
Usage
This is a practical example of how to use.
import { createMongoDbUrl } from "@mongodb-helpers/create-url";
const murl = await createMongoDbUrl({
username: "imed",
password: "my-pwd",
hostname: "my-host.domain.xyz",
port: 12345,
database: "my-db",
});
// you can use the url to connect to mongodb through any client.