ts-lib-mongo-service
v1.1.0
Published
Shared module to connect to mongodb
Downloads
3
Readme
MongoService
Is an util to manage mongodb connection ussing singleton design patter
Requires
- mongodb ^4.13.0
// Pass values to local variables that will be used to create intance and connection
initVars(urlConnection, dataBaseName, useNewUrlParser, unifiedTopology)
// Return a promise after try to connect and init database
getInstance()
// One connected use it get db instance to invoque db methods .find, .updateMany
getDb()