Open Jax89 opened 5 years ago
I can reproduce this:
m <- mongo()
m$insert("{ \"Date\" : { \"$date\" : \"1998-11-07T00:00:00.023Z\" } }")
m$iterate()$json()
I fixed this in mongolite and also reported upstream: https://github.com/mongodb/mongo-c-driver/pull/556
I observed very strange behavior when querying a simple json containing an ISODate including milliseconds using the iterate$json() method. Using iterate$one() the DateTimes are fine. Milliseconds loose leading zeros, see the output below:
The DateTimes stored in the DB are "1998-11-07T00:00:00.123Z" "1998-11-07T00:00:00.023Z" and "1998-11-07T00:00:00.023Z"