Created a data model the records

This commit is contained in:
Alicia Sykes
2017-05-21 08:52:07 +01:00
parent 181960a9d7
commit a34302b5d0
4 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let teamRecordSchema = new Schema({
teamName: String,
data: [
{
date: Date,
userResults: {
userHash: String,
score: String,
comment: String
}
}
]
});
const TeamRecordSchema = mongoose.model('TeamRecord', teamRecordSchema);
module.exports = TeamRecordSchema;

3
tasks/setup/index.js Normal file
View File

@@ -0,0 +1,3 @@
/**
* Created by Alicia on 21/05/2017.
*/

View File

@@ -0,0 +1,15 @@
const fs = require('fs');
import DBConfig from "../server/config/db.conf";
DBConfig.init();
fs.readFile('docs/sample-data.json', function read(err, data) {
if (err) { throw err; }
});