Skip to content

Instantly share code, notes, and snippets.

@ebourmalo
Last active October 6, 2015 19:46
Show Gist options
  • Save ebourmalo/04d80237e32eefb48d6b to your computer and use it in GitHub Desktop.
Save ebourmalo/04d80237e32eefb48d6b to your computer and use it in GitHub Desktop.
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;
@connor11528
Copy link

you never require('feathers-mongoose')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment