This commit is contained in:
Flam3rboy
2021-04-06 23:55:26 +02:00
93 changed files with 17 additions and 3231 deletions
+2 -1
View File
@@ -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);