Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created September 13, 2011 15:26
Show Gist options
  • Save aheckmann/1214108 to your computer and use it in GitHub Desktop.
Save aheckmann/1214108 to your computer and use it in GitHub Desktop.
var mongoose = require('./mongoose');
console.error(mongoose.version);
function dateValueOf (d) {
console.error('date valueOf ran');
return d.valueOf();
}
var S = new mongoose.Schema({
dt: { type: Date, get: dateValueOf }
});
var M = mongoose.model('datevalueof', S);
var m = new M({ dt: new Date });
console.error(m.dt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment