Failed to fetch chrono DateTime from db

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hello, after upgrade to mongodb 2.0 beta and bson 2.0 beta mongodb fails to fetch data.

      I have structure with field:

      #[serde(with = "bson::serde_helpers::chrono_0_4_datetime_as_bson_datetime")]
       pub date: chrono::DateTime<Utc>,

      On find I get the following panic:

      BSON supports millisecond-precision datetimes, could not serialize datetime with greater precision losslessly: 2021-05-21 14:36:29.285007 UTC
      
      Error {
          kind: BsonSerialization(
              SubMillisecondPrecisionDateTime(
                  DateTime(
                      2021-05-22T14:06:13.932566Z,
                  ),
              ),
          ),
          labels: [],
      }

      I tried to downgrade mongodb to first alpha, but the issue still appears there for some reason.

              Assignee:
              Unassigned
              Reporter:
              Max N/A
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: