'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var Vote = new Schema({
	ip: String
});

var Options = new Schema({
	name: String,
	vote: [Vote]
});

var Poll = new Schema({
	user: Number,
	title: String,
	date: Date,
	options: [Options]
});

module.exports = mongoose.model('Poll', Poll);

'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var Vote = new Schema({
	ip: String
});

var Options = new Schema({
	name: String,
	votes: [Vote]
});

var Poll = new Schema({
	user: Number,
	title: String,
	hash: String,
	date: Date,
	votes: Number,
	options: [Options]
});

module.exports = mongoose.model('Poll', Poll);

Modify model for add hash
Modify model for add hash
