summary refs log tree commit diff
path: root/src/util/Database.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-21 17:48:20 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-21 17:48:20 +0200
commitf456a9b1f3175c298644be276be01f79027e9d5d (patch)
tree1b372faf63291744597baaabb7363ead5857ba28 /src/util/Database.ts
parent:sparkles: [Message] Model add created_at (diff)
downloadserver-f456a9b1f3175c298644be276be01f79027e9d5d.tar.xz
:bug: convert string to bigint Permissions
Diffstat (limited to 'src/util/Database.ts')
-rw-r--r--src/util/Database.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/util/Database.ts b/src/util/Database.ts

index 863df663..e5323ed6 100644 --- a/src/util/Database.ts +++ b/src/util/Database.ts
@@ -19,7 +19,15 @@ export default <Connection>connection; function transform<T>(document: T) { // @ts-ignore - if (!document || !document.toObject) return document; + if (!document || !document.toObject) { + try { + // @ts-ignore + delete document._id; + // @ts-ignore + delete document.__v; + } catch (error) {} + return document; + } // @ts-ignore return document.toObject({ virtuals: true }); }