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

Empty ReadConcern and WriteConcern should serialize to BSON documents

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

      Since ReadConcern and WriteConcern may be empty by default, it's possible for their bsonSerialize() methods to return an empty array. This will result in serialization to a BSON array, which would be rejected by the server. We should ensure an object is always returned from these methods.

      This is not an issue for ReadPreference, since it will always contain at least a "mode" field; however, we can also return an object for good measure.

            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: