From 0a3e5cfa95b18ad6445773125e4c1d4fef03d73f Mon Sep 17 00:00:00 2001 From: andwati Date: Tue, 13 Jan 2026 00:32:11 +0300 Subject: [PATCH] feat: update default value for _id fields to use a function for uuid generation --- src/models/order.model.ts | 2 +- src/models/product.model.ts | 2 +- src/models/user.model.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/order.model.ts b/src/models/order.model.ts index 064c971..fd4cd51 100644 --- a/src/models/order.model.ts +++ b/src/models/order.model.ts @@ -43,7 +43,7 @@ const orderSchema = new Schema( { _id: { type: String, - default: uuidv4, + default: () => uuidv4(), }, userId: { type: String, diff --git a/src/models/product.model.ts b/src/models/product.model.ts index 1621642..7558208 100644 --- a/src/models/product.model.ts +++ b/src/models/product.model.ts @@ -14,7 +14,7 @@ const productSchema = new Schema( { _id: { type: String, - default: uuidv4, + default: () => uuidv4(), }, name: { type: String, diff --git a/src/models/user.model.ts b/src/models/user.model.ts index 30baf97..022bcc0 100644 --- a/src/models/user.model.ts +++ b/src/models/user.model.ts @@ -16,7 +16,7 @@ const userSchema = new Schema( { _id: { type: String, - default: uuidv4, + default: () => uuidv4(), }, email: { type: String,