I was expecting that an object with a Date property would be saved in Mongo as an ISODate from both client or server side, but this is not the case.
When I do
if (Meteor.is_client()){
Collection.insert({text : "Client", number : 1, date : new Date() });
Collection.insert({text : "Client", number : 2, date : (new Date()).getTime() });
}
else {
Collection.insert({text : "Server", number : 1, date : new Date() });
}
In mongo it saves like so
{_id : "xx-xx-xx-xx-xx", text : "Client", number : 1, date : "2012-08-21T18:40:47.446" }
{_id : "xx-xx-xx-xx-xx", text : "Client", number : 2, date : 1345574805367 }
{_id : "xx-xx-xx-xx-xx", text : "Server", number : 1, date : ISODate(2012-08-21T18:40:47.446)
Is there a way to save an object with a Date property from client side as an ISODate?