File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Contexts/Shared/infrastructure/persistence/mongo Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export class MongoClientFactory {
2525 const client = new MongoClient ( config . get ( 'mongo.url' ) , { useUnifiedTopology : true } ) ;
2626
2727 await client . connect ( ) ;
28+ client . db ( config . get ( 'mongo.name' ) ) ;
2829
2930 return client ;
3031 }
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ const convictConfig = convict({
1212 doc : 'The Mongo connection URL' ,
1313 format : String ,
1414 env : 'MONGO_URL'
15+ } ,
16+ name : {
17+ doc : 'The Mongo database name' ,
18+ format : String ,
19+ env : 'MONGO_DB_NAME'
1520 }
1621 }
1722} ) ;
Original file line number Diff line number Diff line change 11{
2- "mongo" : { "url" : " mongodb://localhost:27017/mongo " }
2+ "mongo" : { "url" : " mongodb://localhost:27017" , "name" : " test " }
33}
You can’t perform that action at this time.
0 commit comments