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