Last active
October 6, 2015 19:46
-
-
Save ebourmalo/04d80237e32eefb48d6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var ObjectId = mongoose.Schema.Types.ObjectId; | |
var answerSchema = new Schema({ | |
description: {type: String, required: true}, | |
fileId: String, | |
fileName: String, | |
author: { | |
email: String, | |
label: String, | |
username: String | |
}, | |
created: {type: Date, 'default': Date.now} | |
}); | |
var schema = new Schema({ | |
question: {type: String, required: true}, | |
author: { | |
label: String, | |
username: String, | |
points: Number, | |
tags: Array, | |
job: String, | |
description: String, | |
avatar: String | |
}, | |
tags: Array, | |
labels: Array, | |
fileId: String, | |
created: {type: Date, 'default': Date.now}, | |
lastActivity: {type: Date, 'default': Date.now}, | |
answers: [answerSchema] | |
}); | |
var Question = mongoose.model('question', schema); | |
module.exports = Question; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you never
require('feathers-mongoose')