summary refs log tree commit diff
path: root/src/db/schemas/sensorHistory.js
diff options
context:
space:
mode:
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' }