From 558245f876df7ee43203448d6286323272893c2e Mon Sep 17 00:00:00 2001 From: RustamRu Date: Sun, 12 Jan 2025 11:12:24 +0300 Subject: [PATCH] delete masters _id --- server/routers/dry-wash/model/master.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/routers/dry-wash/model/master.js b/server/routers/dry-wash/model/master.js index bf718df..17d51d1 100644 --- a/server/routers/dry-wash/model/master.js +++ b/server/routers/dry-wash/model/master.js @@ -11,6 +11,9 @@ const schema = new Schema({ schema.set('toJSON', { virtuals: true, versionKey: false, + transform(_doc, ret) { + delete ret._id; + } }) schema.virtual('id').get(function () {