2015-03-03 09:41:32 +00:00
|
|
|
var mongoose = require('mongoose');
|
|
|
|
var secrets = require('../config/secrets');
|
|
|
|
|
|
|
|
var storySchema = new mongoose.Schema({
|
2015-03-03 10:23:56 +00:00
|
|
|
headline: {
|
|
|
|
type: String,
|
|
|
|
unique: false
|
|
|
|
},
|
2015-03-04 03:55:04 +00:00
|
|
|
timePosted: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
2015-03-03 10:23:56 +00:00
|
|
|
link: {
|
|
|
|
type: String,
|
|
|
|
unique: false
|
|
|
|
},
|
2015-03-09 09:36:55 +00:00
|
|
|
metaDescription: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
unique: false
|
|
|
|
},
|
2015-03-05 10:21:26 +00:00
|
|
|
description: {
|
2015-03-03 10:23:56 +00:00
|
|
|
type: String,
|
|
|
|
unique: false
|
|
|
|
},
|
2015-04-08 07:30:51 +00:00
|
|
|
originalStoryAuthorEmail: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
|
|
|
},
|
2015-03-03 10:23:56 +00:00
|
|
|
rank: {
|
|
|
|
type: Number,
|
|
|
|
default: -Infinity
|
|
|
|
},
|
|
|
|
upVotes: {
|
|
|
|
type: Array,
|
|
|
|
default: []
|
|
|
|
},
|
2015-03-03 09:41:32 +00:00
|
|
|
author: {},
|
2015-03-03 10:23:56 +00:00
|
|
|
comments: {
|
|
|
|
type: Array,
|
|
|
|
default: []
|
2015-03-05 10:21:26 +00:00
|
|
|
},
|
|
|
|
image: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
|
|
|
},
|
|
|
|
storyLink: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
2015-03-03 10:23:56 +00:00
|
|
|
}
|
2015-03-03 09:41:32 +00:00
|
|
|
});
|
|
|
|
|
2015-03-30 20:48:54 +00:00
|
|
|
module.exports = mongoose.model('Story', storySchema);
|