From 20660444fd9a20c192301b62f4ef284c8f507b55 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 16 Feb 2021 21:40:58 +0100 Subject: :bug: fix Mongodb BigInt --- src/util/MongoBigInt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/MongoBigInt.ts b/src/util/MongoBigInt.ts index cc185bed..e16d087a 100644 --- a/src/util/MongoBigInt.ts +++ b/src/util/MongoBigInt.ts @@ -33,7 +33,7 @@ class LongSchema extends mongoose.SchemaType { cast(val: any, scope?: any, init?: any) { if (null === val) return val; if ("" === val) return null; - + if (typeof val === "bigint") return mongoose.mongo.Long.fromString(val.toString()); if (val instanceof mongoose.mongo.Long) return BigInt(val.toString()); if (val instanceof Number || "number" == typeof val) return BigInt(val); if (!Array.isArray(val) && val.toString) return BigInt(val.toString()); -- cgit 1.5.1