UNPKG

@notross/mongo-singleton

Version:

A lightweight, zero-fuss way to get a single shared MongoDB connection across your Node.js codebase.

18 lines 628 B
import { ConnectionProps } from './types'; /** * Builds a MongoDB connection string from granular connection properties. * * @param props - Full connection properties used to compose the URI. * @returns The formatted MongoDB URI. * @example * const uri = buildConnectionString({ * prefix: 'mongodb://', * username: 'user', * password: 'pass', * host: 'localhost', * port: 27017, * defaultauthdb: 'admin', * }); */ export declare function buildConnectionString({ prefix, username, password, host, port, defaultauthdb, authSource, options, }: ConnectionProps): string; //# sourceMappingURL=utils.d.ts.map