From 7d9cc0efbf536bcf9bf596360bd8a12652d85b95 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 6 Apr 2021 22:06:53 +0200 Subject: :art: remove _id and __v from response --- dist/models/index.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dist/models/index.js (limited to 'dist/models/index.js') diff --git a/dist/models/index.js b/dist/models/index.js new file mode 100644 index 00000000..3c81f38f --- /dev/null +++ b/dist/models/index.js @@ -0,0 +1,42 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const mongoose_1 = __importDefault(require("mongoose")); +__exportStar(require("./Ban"), exports); +__exportStar(require("./Channel"), exports); +__exportStar(require("./Emoji"), exports); +__exportStar(require("./Guild"), exports); +__exportStar(require("./Invite"), exports); +__exportStar(require("./Member"), exports); +__exportStar(require("./Role"), exports); +__exportStar(require("./User"), exports); +__exportStar(require("./Activity"), exports); +__exportStar(require("./Application"), exports); +__exportStar(require("./Interaction"), exports); +__exportStar(require("./Message"), exports); +__exportStar(require("./Status"), exports); +__exportStar(require("./VoiceState"), exports); +__exportStar(require("./Event"), exports); +mongoose_1.default.plugin((schema) => { + schema.options.toJSON = { + virtuals: true, + versionKey: false, + transform(doc, ret) { + delete ret._id; + delete ret.__v; + }, + }; +}); +//# sourceMappingURL=index.js.map \ No newline at end of file -- cgit 1.5.1