You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.1 KiB
60 lines
1.1 KiB
let games = {//Games MODEL
|
|
|
|
"winCon":"winCondition",
|
|
"played":"boolean",
|
|
"playerA":
|
|
{
|
|
"_id":"id",
|
|
"champ":"champName",
|
|
"champSkin":"champskin",
|
|
"rank":"playerRank",
|
|
"winner":"boolean",
|
|
"summoners":
|
|
{
|
|
"s1":"spellName",
|
|
"s2":"spellName"
|
|
},
|
|
"runes":{},//Runes
|
|
"score":"",
|
|
"creepScore":""
|
|
},
|
|
"playerB":
|
|
{
|
|
"_id": "id",
|
|
"champ": "champName",
|
|
"champSkin": "champskin",
|
|
"rank": "playerRank",
|
|
"winner": "boolean",
|
|
"summoners":
|
|
{
|
|
"s1": "spellName",
|
|
"s2": "spellName"
|
|
},
|
|
"runes": {}, //Runes
|
|
"score": "",
|
|
"creepScore":""
|
|
}
|
|
}
|
|
|
|
const mongoose = require('mongoose');
|
|
const Schema = mongoose.Schema;
|
|
|
|
let Game =
|
|
new Schema(
|
|
{
|
|
winCon: {type: String, required: false, max: 100},
|
|
played: {type:Boolean, required: true,},
|
|
playerA: {type:Object, required:true},
|
|
playerA: {type:Object, required:true},
|
|
playerB: {type:Object, required:true}
|
|
}
|
|
);
|
|
|
|
|
|
|
|
|
|
const G= module.exports = mongoose.model('user', Game);
|
|
module.exports.get = (callback, limit)=>
|
|
{
|
|
G.find(callback).limit(limit);
|
|
} |