Get initial view working, sort out mongo mess with seed file

This commit is contained in:
Nathan Leniz
2015-03-03 19:23:56 +09:00
parent b7a95ee56f
commit 52e494407b
7 changed files with 86 additions and 43 deletions

View File

@@ -2,13 +2,31 @@ var mongoose = require('mongoose');
var secrets = require('../config/secrets');
var storySchema = new mongoose.Schema({
headline: String,
link: String,
body: String,
rank: { type: Number, default: -Infinity },
upVotes: { type: Array, default: [] },
headline: {
type: String,
unique: false
},
link: {
type: String,
unique: false
},
body: {
type: String,
unique: false
},
rank: {
type: Number,
default: -Infinity
},
upVotes: {
type: Array,
default: []
},
author: {},
comments: { type: Array, default: [] }
comments: {
type: Array,
default: []
}
});
module.exports = mongoose.model('Story', storySchema);