I expected that an object with a Date property would be saved in Mongo as ISODate from the 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 that
{_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 on the client side as ISODate?
source share