Add prediction model
This commit is contained in:
parent
b189c62840
commit
67d59cedfe
8
src/models/prediction.ts
Normal file
8
src/models/prediction.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import mongoose from 'mongoose';
|
||||||
|
|
||||||
|
|
||||||
|
const PredictionSchema = new mongoose.Schema({
|
||||||
|
values: [{ spectrumName: String, value: Number }]
|
||||||
|
});
|
||||||
|
|
||||||
|
export default mongoose.model<any, mongoose.Model<any, any>>('prediction', PredictionSchema);
|
@ -1,6 +1,7 @@
|
|||||||
import mongoose from 'mongoose';
|
import mongoose from 'mongoose';
|
||||||
import db from '../db';
|
import db from '../db';
|
||||||
import ModelModel from './model';
|
import ModelModel from './model';
|
||||||
|
import PredictionModel from './prediction';
|
||||||
|
|
||||||
const UserSchema = new mongoose.Schema({
|
const UserSchema = new mongoose.Schema({
|
||||||
name: {type: String, index: {unique: true}},
|
name: {type: String, index: {unique: true}},
|
||||||
@ -11,6 +12,7 @@ const UserSchema = new mongoose.Schema({
|
|||||||
location: String,
|
location: String,
|
||||||
devices: [String],
|
devices: [String],
|
||||||
models: [{type: mongoose.Schema.Types.ObjectId, ref: ModelModel}],
|
models: [{type: mongoose.Schema.Types.ObjectId, ref: ModelModel}],
|
||||||
|
predictions: [{type: mongoose.Schema.Types.ObjectId, ref: PredictionModel}],
|
||||||
status: String
|
status: String
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user