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

Failed to fetch chrono DateTime from db

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

      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 Unassigned
            Reporter:
            ockonal@gmail.com Max N/A
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: