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.
|