mangaReader/models/user.js

16 lines
387 B

const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let user =
new Schema(
{
username: {type: String, required: true, max: 100},
hash: {type: String, required: true, max: 100}
}
);
const User = module.exports = mongoose.model('favorite', user, 'mangareader');
module.exports.get = (callback, limit)=>
{
User.find(callback).limit(limit);
}