I solved this problem instantiating a new Date object in node.js:...
In Javascript, send the Date().toISOString() to nodejs:...
var start_date = new Date(2012, 01, 03, 8, 30);
$.ajax({
type: 'POST',
data: { start_date: start_date.toISOString() },
url: '/queryScheduleCollection',
dataType: 'JSON'
}).done(function( response ) { ... });
Then use the ISOString to create a new Date object in nodejs:..
exports.queryScheduleCollection = function(db){
return function(req, res){
var start_date = new Date(req.body.start_date);
db.collection('schedule_collection').find(
{ start_date: { $gte: start_date } }
).toArray( function (err,d){
...
res.json(d)
})
}
};
Note: I'm using Express and Mongoskin.