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

/* define song input schema */
var SongInput = new Schema({
	name: String,
	value: String
});

var Song = new Schema({
	inputs: [SongInput],
	img64px: String,
	img300px: String,
	played: Boolean
});

var setlistSchema = new Schema({
	songs: [Song],
  showID: String,
  createdAt: { type: Date, default: Date.now },
});

var Setlist = mongoose.model('Setlist', setlistSchema);

module.exports = Setlist;

@@ -254,16 +254,174 @@
  Boolean
+,%0A  playedAt: %7B type: Date %7D%0A%7D);%0A%0ASong.pre('save', function(next) %7B%0A  if (this.isModified(%22played%22) && this.played) %7B%0A    playedAt = new Date();%0A  %7D%0A  next();
 %0A%7D);%0A%0Ava

Add playedAt timestamp