2017-02-08 19:52:37 -06:00
|
|
|
'use strict'
|
2016-10-14 22:31:15 -05:00
|
|
|
|
2017-05-13 14:29:00 -05:00
|
|
|
const Mongoose = require('mongoose')
|
|
|
|
|
2016-10-14 22:31:15 -05:00
|
|
|
/**
|
|
|
|
* Entry schema
|
|
|
|
*
|
|
|
|
* @type {<Mongoose.Schema>}
|
|
|
|
*/
|
2016-11-20 19:09:50 -06:00
|
|
|
var entrySchema = Mongoose.Schema({
|
2017-02-08 19:52:37 -06:00
|
|
|
_id: String,
|
2016-10-14 22:31:15 -05:00
|
|
|
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
minlength: 2
|
|
|
|
},
|
|
|
|
subtitle: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
|
|
|
},
|
2017-04-17 21:44:04 -05:00
|
|
|
parentTitle: {
|
2016-10-14 22:31:15 -05:00
|
|
|
type: String,
|
|
|
|
default: ''
|
2017-04-08 15:38:28 -05:00
|
|
|
},
|
|
|
|
parentPath: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
2017-04-17 21:44:04 -05:00
|
|
|
},
|
|
|
|
isDirectory: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2017-04-23 19:45:27 -05:00
|
|
|
},
|
|
|
|
isEntry: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2016-10-14 22:31:15 -05:00
|
|
|
}
|
2017-04-17 21:44:04 -05:00
|
|
|
}, {
|
|
|
|
timestamps: {}
|
|
|
|
})
|
2016-10-14 22:31:15 -05:00
|
|
|
|
2017-02-08 19:52:37 -06:00
|
|
|
module.exports = Mongoose.model('Entry', entrySchema)
|