db admin changes first
This commit is contained in:
parent
4151a833a0
commit
10c956eaeb
10
dbScheme.js
10
dbScheme.js
@ -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
10
deviceSchema.js
Normal 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);
|
2
index.js
2
index.js
@ -2,7 +2,7 @@ const express = require("express");
|
|||||||
const cors = require("cors");
|
const cors = require("cors");
|
||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
const mongoDB = "mongodb://127.0.0.1/chillroom-database";
|
const mongoDB = "mongodb://127.0.0.1/chillroom-database";
|
||||||
const dbSchema = require("./dbScheme");
|
const dbSchema = require("./statusSchema");
|
||||||
mongoose.connect(
|
mongoose.connect(
|
||||||
mongoDB,
|
mongoDB,
|
||||||
{ useNewUrlParser: true }
|
{ useNewUrlParser: true }
|
||||||
|
8
statusSchema.js
Normal file
8
statusSchema.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
const mongoose = require("mongoose");
|
||||||
|
const statusSchema = new mongoose.Schema(
|
||||||
|
{
|
||||||
|
status: [String]
|
||||||
|
},
|
||||||
|
{ timestamps: true }
|
||||||
|
);
|
||||||
|
module.exports = mongoose.model("statusSchema", statusSchema);
|
Loading…
Reference in New Issue
Block a user