Advertisement
jamesmyers

models.js

Mar 2nd, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mongoose = require('mongoose');
  2.  
  3. var pollsSchema = new mongoose.Schema({
  4.     question: String,
  5.     responses: [{
  6.         responseText: String,
  7.         votes: {
  8.             type: Number,
  9.             default: 0
  10.         },
  11.         updated_at: {
  12.             type: Date,
  13.             default: Date.now
  14.         }
  15.  
  16.     }]
  17. });
  18.  
  19. module.exports = mongoose.model('Polls', pollsSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement