mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
adopt to mongodb adapter changes
This commit is contained in:
committed by
Thomas Ruoff
parent
7196bd2e91
commit
893896cf31
12
db/index.ts
12
db/index.ts
@@ -5,16 +5,18 @@ import { BOOKING_STATUS } from './enums'
|
||||
|
||||
let connectedPromise: Promise<mongoose.Mongoose>
|
||||
|
||||
const MONGODB_OPTIONS = {
|
||||
useCreateIndex: true,
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
}
|
||||
|
||||
export function connect(): Promise<mongoose.Mongoose> {
|
||||
if (connectedPromise) {
|
||||
return connectedPromise
|
||||
}
|
||||
|
||||
connectedPromise = mongoose.connect(process.env.MONGO_URI, {
|
||||
useCreateIndex: true,
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
})
|
||||
connectedPromise = mongoose.connect(process.env.MONGO_URI, MONGODB_OPTIONS)
|
||||
|
||||
return connectedPromise
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user