()
| 4 | let connection, db |
| 5 | |
| 6 | export default async function makeDb () { |
| 7 | connection = |
| 8 | connection || |
| 9 | (await MongoClient.connect( |
| 10 | global.__MONGO_URI__, |
| 11 | { useNewUrlParser: true } |
| 12 | )) |
| 13 | db = db || (await connection.db(global.__MONGO_DB_NAME__)) |
| 14 | return db |
| 15 | } |
| 16 | |
| 17 | export async function closeDb () { |
| 18 | await connection.close() |
nothing calls this directly
no outgoing calls
no test coverage detected