From e6830735497f261df1b7e4c56ddb9c7578ef7106 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 6 Apr 2021 23:25:11 +0200 Subject: [PATCH] :arrow_up: update mongodb --- README.md | 10 +++++++++- package-lock.json | Bin 67378 -> 69284 bytes package.json | 2 +- src/util/Database.ts | 3 ++- tsconfig.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c08a72d5..c2d275c4 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ -# server-util \ No newline at end of file +# server-util + +add to package.json: + +```json +"start": "npm run build:util && npm run build && node dist/", +"build": "tsc -b .", +"build:util": "tsc -b ./node_modules/fosscord-server-util/" +``` diff --git a/package-lock.json b/package-lock.json index 4448c6fb63184618a104a8dbefb25802570c2942..0e721c0c18ab3a77c6c71ceca11c0a7785cd4f20 100644 GIT binary patch delta 729 zcmdng$FgKD%Z5lsMzhK9_eg9mVqESydFv$o$q8r0CjVto2n)~2Eb`4P4KoZ4NJ`Bz z^-6X2Ep)Xs_6kai(vPYtbT!ZO3Mmh;Fpa3na&$8(3JOjwG)i)JPBKi+O3U}~@pm&Y z)Ap!vbV&?wFAOnAHx5n;3o$I8oM2B>9NnVS!qUv5R3$3~ zr8q-913jb3A9-XZ*Pm0I{K1E9^0^@C&1-%3@=cx)%EFXiJUKpCZ?mMg4fE!#=r(qK zG(#pcUK5?{z{xV%E=pesO)gbmS07Di^1>*!FpsFxq_7k-&oqzXq`ZO@KR10(=fq&g zDyLA_aKn(y)Utx?tVrV$Cljx{YzrTA?E)|3u<|U zc8F%3EFa7|`SNYi$@*tGC$rzxp1e0$baI?G_vEU};*;yV<0i9RIW+mrRk6($H$GA$ SxFcy3+_tt#n-v}isRIC`wg+JV delta 91 zcmV-h0Hptqk2eX^!2`9JID69Yg diff --git a/package.json b/package.json index 0ac2c9ce..7900d301 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "jsonwebtoken": "^8.5.1", "lambert-db": "^1.1.7", "missing-native-js-functions": "^1.2.2", - "mongodb": "^3.6.4", + "mongodb": "^3.6.6", "mongoose": "^5.12.3" }, "devDependencies": { diff --git a/src/util/Database.ts b/src/util/Database.ts index 6e774262..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 , useNewUrlParser: true, useUnifiedTopology: true }); +const connection = mongoose.createConnection(uri, { autoIndex: true, useNewUrlParser: true, useUnifiedTopology: true }); export default 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); diff --git a/tsconfig.json b/tsconfig.json index 6cc2a681..520774d3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "include": ["src"], + "include": ["src/**/*.ts"], "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */