mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-23 17:19:18 +02:00
some progress
This commit is contained in:
parent
aea93a5527
commit
e3c15bd288
1388 changed files with 306946 additions and 68323 deletions
20
api/models/model.js
Normal file
20
api/models/model.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
const BookSchema = new Schema({
|
||||
name: {
|
||||
type: String,
|
||||
required: 'Enter book name'
|
||||
},
|
||||
Created_date: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
status: {
|
||||
type: [{
|
||||
type: String,
|
||||
enum: ['pending', 'ongoing', 'completed']
|
||||
}],
|
||||
default: ['pending']
|
||||
}
|
||||
});module.exports = mongoose.model('Books', BookSchema);
|
Loading…
Add table
Add a link
Reference in a new issue