Skip to content

Instantly share code, notes, and snippets.

@ebourmalo
Last active August 29, 2015 14:27
Show Gist options
  • Save ebourmalo/11bc914a9a460722a815 to your computer and use it in GitHub Desktop.
Save ebourmalo/11bc914a9a460722a815 to your computer and use it in GitHub Desktop.
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var questionSchema = new Schema({
description: {type: String, required: true},
author: {type: Schema.Types.ObjectId, ref: 'user', required: true},
tags: Array,
fileId: String,
createdAt: {type: Date, default: Date.now},
lastActivityAt: {type: Date, default: Date.now}
}));
var Question = mongoose.model('question', questionSchema);
module.exports = Question;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment