2019-01-12 13:17:52 +01:00
|
|
|
const mongoose = require("mongoose");
|
|
|
|
const statusSchema = new mongoose.Schema(
|
|
|
|
{
|
2019-01-12 15:03:08 +01:00
|
|
|
status: [
|
|
|
|
{
|
|
|
|
value: String,
|
|
|
|
time: Date
|
|
|
|
}
|
|
|
|
],
|
|
|
|
device: {
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
ref: "deviceSchema"
|
|
|
|
}
|
2019-01-12 13:17:52 +01:00
|
|
|
},
|
|
|
|
{ timestamps: true }
|
|
|
|
);
|
|
|
|
module.exports = mongoose.model("statusSchema", statusSchema);
|