🐛 fix database

This commit is contained in:
Flam3rboy committed 2021-02-16 21:16:56 +01:00
1 parent 7e25f67878
commit 57746da872
33 files changed
+109 -34

No files matched your search

+5 -2
View File
@@ -1,9 +1,12 @@
import "./MongoBigInt";
import mongoose, { Collection } from "mongoose";
import mongoose, { Collection, Connection } from "mongoose";
import { ChangeStream, ChangeEvent, Long } from "mongodb";
import EventEmitter from "events";
const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPreference=secondaryPreferred";
export default mongoose.connection;
const connection = mongoose.createConnection(uri, { autoIndex: true });
export default <Connection>connection;
export interface MongooseCache {
on(event: "delete", listener: (id: string) => void): this;