Router thingies!

This commit is contained in:
Kasper Rynning-Tønnesen
2020-01-17 15:59:21 +01:00
parent 11aba3556f
commit 002cf71137
10 changed files with 352 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ const Schema = mongoose.Schema;
const Highscore = new Schema({
name: String,
Wins: [
wins: [
{
color: String,
date: Date,
@@ -15,4 +15,4 @@ const Highscore = new Schema({
]
});
module.exports = Highscore;
module.exports = mongoose.model("Highscore", Highscore);

View File

@@ -6,7 +6,13 @@ const Purchase = new Schema({
blue: Number,
red: Number,
yellow: Number,
green: Number
green: Number,
wines: [
{
type: Schema.Types.ObjectId,
ref: "Wine"
}
]
});
module.exports = Purchase;
module.exports = mongoose.model("Purchase", Purchase);

View File

@@ -4,7 +4,8 @@ const Schema = mongoose.Schema;
const Wine = new Schema({
name: String,
vivinoLink: String,
rating: Number
rating: Number,
occurences: Number
});
module.exports = Wine;
module.exports = mongoose.model("Wine", Wine);