elections-cpl.api.hscc.bdpa.org • Docs
elections-cpl.api.hscc.bdpa.org / lib/mongo-schema / 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
.
• __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.
Promise
<Db
>