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

mongo-rust-driver - PR #948: fixing the find or delete serde inconsistency

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.7.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      mlokr has created PR #948: fixing the find or delete serde inconsistency in mongo-rust-driver

      Issue Text:
      Hello,

      I found an inconsistency in the way mongo documents are deserialized when using `serde(with)` and `find_one_and_delete`. My fix might nor be ideal because it breaks
      ```
      < operation::find_and_modify::test::handle_no_value_delete
      < operation::find_and_modify::test::handle_no_value_replace
      < operation::find_and_modify::test::handle_no_value_update
      ```
      The tests no longer return `Err(_)` but just `Ok(None)`. I am not sure how I can assert that Field is present but can be null, when deserializing `Option<T>` and could not find anything either.

      I added a tests to verify my changes fix the issue (see changes)

            Assignee:
            abraham.egnor@mongodb.com Abraham Egnor
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: