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

Unacknowledged WriteResults have null counts

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0-alpha1, 1.2.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Starting with 1.4.0-dev, libmongoc now omits the count fields from the write result BSON for unacknowledged writes. This causes our methods to return null, while they previously returned zero.

      I propose we allow this behavior change and document it as such in PHPC-653. getModifiedCount already had behavior to conditionally return null, since it is omitted from acknowledged writes to older servers. This would extend that behavior of "null if unavailable" to the other count fields.

      Note: The getter methods in PHPLIB already throw for unacknowledged writes (PHPLIB-68).

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: