finish taller4
This commit is contained in:
26
taller4/models/book.js
Normal file
26
taller4/models/book.js
Normal file
@@ -0,0 +1,26 @@
|
||||
'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);
|
Reference in New Issue
Block a user