// Load required packages
var mongoose = require('mongoose');

// Define our article schema
var DemoSchema = new mongoose.Schema({
  title: {
    type: String,
    unique: true,
    required: true
  },
  description: String,
  html: String,
  css: String,
  javascript: String,
  updatedAt: {type: Date, default: Date.now},
  createdAt: {type: Date, default: Date.now},
  authorId: String
});

// Export the Mongoose model
module.exports = mongoose.model('Demo', DemoSchema);
