-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: BSON
-
None
Due to a typo in the datetime deserialization logic, datetimes between the year 10,000 and 99,999 cannot be deserialized from Document. This is because, internally, the relaxed extended JSON format of the date is used for those years when it's supposed to stop at 9,999 (with canonical being used for the rest of the range).
repro:
let d = bson::DateTime::from_millis(253402300800000); let doc = doc! { "d": d }; #[derive(Deserialize, Debug)] struct D { d: DateTime } println!("{:?}", bson::from_document::<D>(doc));