summary refs log tree commit diff
path: root/src/db/schemas/user.js
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-06-03 01:01:40 +0200
committerRory& <root@rory.gay>2025-06-03 01:01:40 +0200
commit6f3f08ed340e59a62a2d0428a5c32f99551ef1ce (patch)
treeff77390b1d3ea61414c14c94ac1fa2a05030879b /src/db/schemas/user.js
parentMore alarm testing (diff)
downloadnodejs-final-assignment-6f3f08ed340e59a62a2d0428a5c32f99551ef1ce.tar.xz
Fix performance issues, add fake user bot to test client, more testing
Diffstat (limited to 'src/db/schemas/user.js')
-rw-r--r--src/db/schemas/user.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/db/schemas/user.js b/src/db/schemas/user.js

index 7680319..7a4b2f4 100644 --- a/src/db/schemas/user.js +++ b/src/db/schemas/user.js
@@ -30,18 +30,21 @@ export const deviceSchema = new Schema({ } }); -export const alarmSchema = new Schema({ - createdAt: { - type: Date, - default: Date.now, - immutable: true +export const alarmSchema = new Schema( + { + reason: { + type: String, + enum: Object.values(AlarmType), + required: true + } }, - reason: { - type: String, - enum: Object.values(AlarmType), - required: true + { + timestamps: { + createdAt: true, + updatedAt: false + } } -}); +); /** * User schema for MongoDB.