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.
47 lines
783 B
47 lines
783 B
let leaguesModel = {//Leagues[0]
|
|
"name":"Legendary",
|
|
"players":
|
|
[
|
|
{
|
|
"name":"String",
|
|
"points":10,
|
|
"playedMatches":10
|
|
},
|
|
{
|
|
"name":"String",
|
|
"points":10,
|
|
"playedMatches":10
|
|
}
|
|
],
|
|
"games":
|
|
[
|
|
{
|
|
"_id":"String"
|
|
},
|
|
{
|
|
"_id": "String"
|
|
}
|
|
]
|
|
}
|
|
|
|
|
|
const mongoose = require('mongoose');
|
|
const Schema = mongoose.Schema;
|
|
|
|
let League =
|
|
new Schema(
|
|
{
|
|
name: {type: String, required: false, max: 100},
|
|
players: {type:Array, required: true,},
|
|
games: {type:Array, required:true}
|
|
}
|
|
);
|
|
|
|
|
|
|
|
|
|
const L = module.exports = mongoose.model('user', League);
|
|
module.exports.get = (callback, limit)=>
|
|
{
|
|
L.find(callback).limit(limit);
|
|
} |