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
|
|
|
|
},
|
|
|
|
link: {
|
|
|
|
type: String,
|
|
|
|
unique: false
|
|
|
|
},
|
|
|
|
body: {
|
|
|
|
type: String,
|
|
|
|
unique: false
|
|
|
|
},
|
|
|
|
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-03 09:41:32 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Story', storySchema);
|
|
|
|
|