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

Add Read, ReadWrite, and Write command execute methods

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0-beta1, 1.4.0
    • Affects Version/s: 1.2.0-alpha3
    • Component/s: None
    • Labels:
      None

      mongoc_client_read_write_command_with_opts() includes logic to inject the mongo_client_t's read concern, read preference, and write concern if said options are not specified in the BSON options (not the same as the command document). Since PHPLIB currently passes in these options in the command document, a simple migration to mongoc_client_read_write_command_with_opts() would see duplicate fields injected by libmongoc. Therefore, PHPC's executeCommand() methods will need to extract these fields from command documents and supply them in the separate BSON options document.

      When combined with PHPLIB-261, this will ensure that only PHPC and libmongoc are responsible for injecting client-level options into commands.


      Lastly, it should be noted that mongoc_client_read_write_command_with_opts() does not inspect a command document to determine whether it is a read or write command. The default behavior will see read concern and write concern always injected from mongo_client_t if not provided in BSON options. Therefore, the PHP driver may need to implement some detection on its own to determine whether to call mongoc_client_read_command_with_opts() or mongoc_client_write_command_with_opts() on a per-command basis.

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

              Created:
              Updated:
              Resolved: