-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
None
-
Affects Version/s: None
-
Component/s: EJSON
-
Empty show more show less
I'd expect the following code:
EJSON.parse('{"grant_date":{"$date":{"$numberLong":"1452124800000"}}}', {"relaxed": true})
To give me:
{ grant_date: 2016-01-07T00:00:00.000Z }
But I get the current time:
{ grant_date: 2018-04-30T17:10:14.832Z }
The Stitch JS SDK like to give users types back in a relaxed format after parse which normally works with the above for most types but it's not working for $date since a $numberLong becomes a "number" and the $date decoder cannot parse that.