mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-24 11:03:17 -04:00
40 lines
709 B
JavaScript
40 lines
709 B
JavaScript
var mongoose = require('mongoose');
|
|
|
|
var commentSchema = new mongoose.Schema({
|
|
associatedPost: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
originalStoryLink: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
originalStoryAuthorEmail: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
body: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
rank: {
|
|
type: Number,
|
|
default: -Infinity
|
|
},
|
|
upvotes: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
author: {},
|
|
comments: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
commentOn: {
|
|
type: Number,
|
|
default: Date.now()
|
|
}
|
|
});
|
|
|
|
module.exports = mongoose.model('Comment', commentSchema);
|