Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-1899

Write results should be optional to accommodate unacknowledged write concerns

    • Type: Icon: Spec Change Spec Change
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: CRUD
    • None
    • Not Needed

      Summary

      Write Results states that the acknowledged property on result objects exists for languages that do not return an optional type. This implies that those write methods should actually be documented as returning an optional (e.g. bulkWrite should return Optional<BulkWriteResult>). Note that findAndModify operations may need similar clarifications (permitting an optional or null return value), as the spec currently documents those methods are returning a non-optional Document (findAndModify with {w:0} comes back with a {ok:1} response and would not have any document to return).

      This came up while working on DRIVERS-1340.

      Motivation

      Who is the affected end user?

      Driver authors. This ticket is strictly a clarification and should have no impact on driver APIs or users.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      No. This ticket only pertains to the spec language. Any unified tests that do assert results for unacknowledged writes should utilize $unsetOrMatches on the expected result.

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

              Created:
              Updated:
              Resolved: