Unacknowledged WriteResults have null counts

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.2.0-alpha1, 1.2.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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:
            Jeremy Mikola
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: