entry.js 596 Bytes
Newer Older
1
'use strict'
2

3 4
const Mongoose = require('mongoose')

5 6 7 8 9
/**
 * Entry schema
 *
 * @type       {<Mongoose.Schema>}
 */
NGPixel's avatar
NGPixel committed
10
var entrySchema = Mongoose.Schema({
11
  _id: String,
12 13 14 15 16 17 18 19 20 21

  title: {
    type: String,
    required: true,
    minlength: 2
  },
  subtitle: {
    type: String,
    default: ''
  },
NGPixel's avatar
NGPixel committed
22
  parentTitle: {
23 24
    type: String,
    default: ''
NGPixel's avatar
NGPixel committed
25 26 27 28
  },
  parentPath: {
    type: String,
    default: ''
NGPixel's avatar
NGPixel committed
29 30 31 32
  },
  isDirectory: {
    type: Boolean,
    default: false
33 34 35 36
  },
  isEntry: {
    type: Boolean,
    default: false
37
  }
NGPixel's avatar
NGPixel committed
38 39 40
}, {
  timestamps: {}
})
41

42
module.exports = Mongoose.model('Entry', entrySchema)