diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-02-16 20:59:31 +0100 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-02-16 20:59:31 +0100 |
commit | 7e25f67878a632529334f75677be76c474240a53 (patch) | |
tree | 753ac4e541cc5f98e179b88cbbdf2c8c0b3fca14 /src/util | |
parent | :bug: fix Message Model (diff) | |
download | server-7e25f67878a632529334f75677be76c474240a53.tar.xz |
:bug: fix database
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/Database.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/util/Database.ts b/src/util/Database.ts index 2304378c..1ebfbd12 100644 --- a/src/util/Database.ts +++ b/src/util/Database.ts @@ -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; |