WriteResult getters should return null and emit deprecation notice for w:0 writes and return zero otherwise if libmongoc result is omitted

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      MongoDB\Driver\WriteResult getters currently return null if the libmongoc result document omits an expected field.

      • Continue to return null for unacknowledged writes, but raise a deprecation notice informing users that this may change in 2.0 (see: PHPC-2144)
      • Return 0 for any acknowledged writes if the field is not present. This may not actually happen in libmongoc, but it'd be a good defensive approach since results are BSON documents.

            Assignee:
            Andreas Braun
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: