db admin changes first

This commit is contained in:
Dawid Kubicki 2019-01-12 13:17:52 +01:00
parent 4151a833a0
commit 10c956eaeb
4 changed files with 19 additions and 11 deletions

View File

@ -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);

10
deviceSchema.js Normal file
View File

@ -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);

View File

@ -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 }

8
statusSchema.js Normal file
View File

@ -0,0 +1,8 @@
const mongoose = require("mongoose");
const statusSchema = new mongoose.Schema(
{
status: [String]
},
{ timestamps: true }
);
module.exports = mongoose.model("statusSchema", statusSchema);