diff options
Diffstat (limited to 'src/util/MongoBigInt.ts')
-rw-r--r-- | src/util/MongoBigInt.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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()); |