taller-web/taller4/models/book.js
2021-11-10 16:58:48 -03:00

27 lines
444 B
JavaScript

'use strict'
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const BookSchema = Schema(
{
nombre: {
type:String,
required: true
},
anio: {
type:Number,
required: true
},
idioma: {
type: String,
enum: ['ING','ESP'],
required: true
},
autor: {
type:String,
required: true
}
}
);
module.exports = mongoose.model('books', BookSchema);