Schemas I think
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
const mongoose = require("mongoose");
|
||||||
|
const Schema = mongoose.Schema;
|
||||||
|
|
||||||
|
const Highscore = new Schema({
|
||||||
|
name: String,
|
||||||
|
Wins: [
|
||||||
|
{
|
||||||
|
color: String,
|
||||||
|
date: Date,
|
||||||
|
wine: {
|
||||||
|
type: Schema.Types.ObjectId,
|
||||||
|
ref: "Wine"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = Highscore;
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
const mongoose = require("mongoose");
|
||||||
|
const Schema = mongoose.Schema;
|
||||||
|
|
||||||
|
const Purchase = new Schema({
|
||||||
|
date: Date,
|
||||||
|
blue: Number,
|
||||||
|
red: Number,
|
||||||
|
yellow: Number,
|
||||||
|
green: Number
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = Purchase;
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
const mongoose = require("mongoose");
|
||||||
|
const Schema = mongoose.Schema;
|
||||||
|
const passportLocalMongoose = require("passport-local-mongoose");
|
||||||
|
|
||||||
|
const User = new Schema({});
|
||||||
|
|
||||||
|
User.plugin(passportLocalMongoose);
|
||||||
|
|
||||||
|
module.exports = mongoose.model("User", User);
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const mongoose = require("mongoose");
|
||||||
|
const Schema = mongoose.Schema;
|
||||||
|
|
||||||
|
const Wine = new Schema({
|
||||||
|
name: String,
|
||||||
|
vivinoLink: String,
|
||||||
|
rating: Number
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = Wine;
|
||||||
|
|||||||
Reference in New Issue
Block a user