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.

56 lines
1.4 KiB

const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let leagueGameM =
new Schema(
{
PA:{type:Object, required:true},
PB:{type:Object, required:true},
Winner:{type:String, required:true},
WinCondition:{type:String, required:true},
Played:{type:Boolean, required:true},
PlayedTimeStamp:{type:String, required:true}
}
);
const leagueGame = module.exports = mongoose.model('leagueGames', leagueGameM);
module.exports.get = (callback, limit)=>
{
leagueGame.find(callback).limit(limit);
}
/**
*
result:{
winCondition:'string'
winner:string
},
gameData:
{
PlayerA:
{
championName:PA.championName,
items:PA.items,
level:PA.level,
runes:PA.runes,
skin:PA.skinID,
skinName:PA.skinName,
summs:PA.summonerSpells
},
PlayerB:
{
championName:PB.championName,
items:PB.items,
level:PB.level,
runes:PB.runes,
skin:PB.skinID,
skinName:PB.skinName,
summs:PB.summonerSpells
},
gameTime:data.gameData.gameTime
}
*/