summaryrefslogtreecommitdiff
path: root/models/cmmnt.js
blob: 4373e8a2140eca4d5df85ad61e59276cd4ee643b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const mongoose = require('mongoose');

//Schema Setup
const cmmntSchema = new mongoose.Schema({
    text: String,
    author: {
        id: {
            type: mongoose.Schema.Types.ObjectId,
            ref: 'User'
        },
        username: String
    }
});

module.exports = new mongoose.model('Cmmnt', cmmntSchema);