18 lines
347 B
JavaScript
18 lines
347 B
JavaScript
const mongoose = require("mongoose");
|
|
const statusSchema = new mongoose.Schema(
|
|
{
|
|
status: [
|
|
{
|
|
value: String,
|
|
time: Date
|
|
}
|
|
],
|
|
device: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: "deviceSchema"
|
|
}
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
module.exports = mongoose.model("statusSchema", statusSchema);
|