'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Wish Schema
 */
var WishSchema = new Schema({
	name: {
		type: String,
		default: '',
		required: 'Please fill Wish name',
		trim: true
	},
	created: {
		type: Date,
		default: Date.now
	},
	user: {
		type: Schema.ObjectId,
		ref: 'User'
	}
}, {
	autoIndex: process.env('mode') == 'development'
});

mongoose.model('Wish', WishSchema);
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Wish Schema
 */
var WishSchema = new Schema({
	name: {
		type: String,
		default: '',
		required: 'Please fill Wish name',
		trim: true
	},
	created: {
		type: Date,
		default: Date.now
	},
	user: {
		type: Schema.ObjectId,
		ref: 'User'
	}
}, {
	autoIndex: process.env.NODE_ENV == 'development'
});

mongoose.model('Wish', WishSchema);
Check NODE_ENv varibale for setting environment configuration
Check NODE_ENv varibale for setting environment configuration
