Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 1009 Bytes

File metadata and controls

40 lines (23 loc) · 1009 Bytes

elections-cpl.api.hscc.bdpa.orgDocs


elections-cpl.api.hscc.bdpa.org / lib/mongo-schema / getDb

Function: getDb()

getDb(__namedParameters): Promise<Db>

Lazily connects to a database on-demand, memoizing the result. If the database does not yet exist, it is both created and initialized by this function. The latter can be prevented by setting initialize to false.

Parameters

__namedParameters

__namedParameters.initialize?: boolean

Set to false to prevent getDb from calling initializeDb if the database does not exist prior to acquiring it.

Default

true

__namedParameters.name: string

The name or alias of the database to retrieve.

Returns

Promise<Db>

Source

lib/mongo-schema/index.ts:218