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.

23 lines
504 B

const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let leagueM =
new Schema(
{
Name: {type: String, required: true, max: 20, unique:true},
Players: {type: Array, required: true, max: 10},
Games:{type: Array, required:true},
Owner:{type:String, required:true}
}
);
const League = module.exports = mongoose.model('leagues',leagueM);
module.exports.get = (callback, limit)=>
{
League.find(callback).limit(limit);
}