🐛 fix database

This commit is contained in:
Flam3rboy
2021-02-16 20:59:31 +01:00
parent b5b6f7b559
commit 7e25f67878
3 changed files with 4 additions and 9 deletions
+2 -5
View File
@@ -1,12 +1,9 @@
import "./MongoBigInt";
import mongoose, { Collection, Connection } from "mongoose";
import mongoose, { Collection } from "mongoose";
import { ChangeStream, ChangeEvent, Long } from "mongodb";
import EventEmitter from "events";
const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPreference=secondaryPreferred";
const connection = mongoose.createConnection(uri, { autoIndex: true });
export default <Connection>connection;
export default mongoose.connection;
export interface MongooseCache {
on(event: "delete", listener: (id: string) => void): this;