diff --git a/dbScheme.js b/dbScheme.js deleted file mode 100644 index dbcc024..0000000 --- a/dbScheme.js +++ /dev/null @@ -1,10 +0,0 @@ -const mongoose = require("mongoose"); -const dbSchema = new mongoose.Schema( - { - ip: String, - name: String, - status: String - }, - { timestamps: true } -); -module.exports = mongoose.model("dbSchema", dbSchema); diff --git a/deviceSchema.js b/deviceSchema.js new file mode 100644 index 0000000..971888f --- /dev/null +++ b/deviceSchema.js @@ -0,0 +1,10 @@ +const mongoose = require("mongoose"); +const deviceSchema = new mongoose.Schema( + { + ip: String, + name: String, + updateStatuses: [String] + }, + { timestamps: true } +); +module.exports = mongoose.model("deviceSchema", deviceSchema); diff --git a/index.js b/index.js index 5443f95..83c5e10 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const express = require("express"); const cors = require("cors"); const mongoose = require("mongoose"); const mongoDB = "mongodb://127.0.0.1/chillroom-database"; -const dbSchema = require("./dbScheme"); +const dbSchema = require("./statusSchema"); mongoose.connect( mongoDB, { useNewUrlParser: true } diff --git a/statusSchema.js b/statusSchema.js new file mode 100644 index 0000000..f7146d6 --- /dev/null +++ b/statusSchema.js @@ -0,0 +1,8 @@ +const mongoose = require("mongoose"); +const statusSchema = new mongoose.Schema( + { + status: [String] + }, + { timestamps: true } +); +module.exports = mongoose.model("statusSchema", statusSchema);