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 {
25
25
const client = new MongoClient ( config . get ( 'mongo.url' ) , { useUnifiedTopology : true } ) ;
26
26
27
27
await client . connect ( ) ;
28
+ client . db ( config . get ( 'mongo.name' ) ) ;
28
29
29
30
return client ;
30
31
}
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ const convictConfig = convict({
12
12
doc : 'The Mongo connection URL' ,
13
13
format : String ,
14
14
env : 'MONGO_URL'
15
+ } ,
16
+ name : {
17
+ doc : 'The Mongo database name' ,
18
+ format : String ,
19
+ env : 'MONGO_DB_NAME'
15
20
}
16
21
}
17
22
} ) ;
Original file line number Diff line number Diff line change 1
1
{
2
- "mongo" : { "url" : " mongodb://localhost:27017/mongo " }
2
+ "mongo" : { "url" : " mongodb://localhost:27017" , "name" : " test " }
3
3
}
You can’t perform that action at this time.
0 commit comments