summary refs log tree commit diff
path: root/src/db/schemas/sensorHistory.js
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-06-03 22:15:43 +0200
committerRory& <root@rory.gay>2025-06-03 22:15:43 +0200
commit2034f459d416afdead72e590f870567452b2c62a (patch)
tree167d52739a058498a5c5877e64f806553543973c /src/db/schemas/sensorHistory.js
parentRemove admin account routes, fix multiple routes (diff)
downloadnodejs-final-assignment-2034f459d416afdead72e590f870567452b2c62a.tar.xz
Prepare for budgeting, move to native createdAt
Diffstat (limited to 'src/db/schemas/sensorHistory.js')
-rw-r--r--src/db/schemas/sensorHistory.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/db/schemas/sensorHistory.js b/src/db/schemas/sensorHistory.js

index 152f03a..e016079 100644 --- a/src/db/schemas/sensorHistory.js +++ b/src/db/schemas/sensorHistory.js
@@ -6,11 +6,6 @@ import { model, Schema, ObjectId } from 'mongoose'; */ export const sensorHistorySchema = new Schema( { - createdAt: { - type: Date, - default: Date.now, - immutable: true - }, sensor: { type: String, required: true, @@ -23,6 +18,10 @@ export const sensorHistorySchema = new Schema( } }, { + timestamps: { + createdAt: true, + updatedAt: false + }, timeseries: { timeField: 'createdAt' }