Created
September 13, 2011 15:26
-
-
Save aheckmann/1214108 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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