Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Idea Schema
*/
var IdeaSchema = new Schema({
name: {
type: String,
default: '',
required: 'Idea name required',
trim: true
},
description: {
type: String,
default: '',
trim: true
},
tags: {
type: [String]
},
created: {
type: Date,
default: Date.now
},
user: {
type: Schema.ObjectId,
ref: 'User'
},
developed: {
type: Number,
min: 1,
max: 3
},
focused: {
type: Number,
min: 1,
max: 3
},
simple: {
type: Number,
min: 1,
max: 3
},
difficult: {
type: Number,
min: 1,
max: 3
},
realistic: {
type: Number,
min: 1,
max: 3
},
time: {
type: Number,
min: 1,
max: 3
},
money: {
type: Number,
min: 1,
max: 3
},
potential: {
type: Number,
min: 1,
max: 3
}
});
mongoose.model('Idea', IdeaSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.