Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-2142

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

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.15.0
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Andreas Braun
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: