summary refs log tree commit diff
path: root/src/util/Database.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 23:25:56 +0200
committerGitHub <noreply@github.com>2021-04-06 23:25:56 +0200
commite8c79c8e48b1a69fe7662e9b3bc8f5366d328475 (patch)
treeb4d69ea9692670e4338bf23db5fd0312b5cd6c17 /src/util/Database.ts
parent:bug: fix Message Model (diff)
parent:arrow_up: update mongodb (diff)
downloadserver-e8c79c8e48b1a69fe7662e9b3bc8f5366d328475.tar.xz
Merge pull request #2 from afeuerstein/main
Merge fosscord/fosscord-server-util/ with afeuerstein/fosscord-server-util/
Diffstat (limited to 'src/util/Database.ts')
-rw-r--r--src/util/Database.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/Database.ts b/src/util/Database.ts

index fee3cc31..883c8dcd 100644 --- a/src/util/Database.ts +++ b/src/util/Database.ts
@@ -6,7 +6,7 @@ const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPre console.log(`[DB] connect: ${uri}`); -const connection = mongoose.createConnection(uri, { autoIndex: true }); +const connection = mongoose.createConnection(uri, { autoIndex: true, useNewUrlParser: true, useUnifiedTopology: true }); export default <Connection>connection; @@ -32,6 +32,7 @@ export class MongooseCache extends EventEmitter { } init = async () => { + // @ts-ignore this.stream = this.collection.watch(this.pipeline, { fullDocument: "updateLookup" }); this.stream.on("change", this.change);