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

XMLWordPrintableJSON

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

      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
              Reporter:
              TPM Jira Automations Bot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: