Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-821

Failed to fetch chrono DateTime from db

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Unknown
    • Resolution: Duplicate
    • None
    • None
    • BSON

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ockonal@gmail.com Max N/A
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: