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

Refactor _id extraction for insert documents

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: None
    • PHP Drivers

      introduced an internal phongo_bwc_extract_id method based on php_phongo_bulkwrite_extract_id. This can be refactored to use a common utility function.

      Additionally, the original approach in php_phongo_bulkwrite_extract_id that converts the entire document can be rewritten to iterate BSON and use phongo_bson_value_to_zval.

      Targeting this change for 2.0 would mean that we need not prefer phongo_bson_value_to_zval_legacy for the original php_phongo_bulkwrite_extract_id code path. It would be acceptable to return document values for _id as a Document instance instead of stdClass (admittedly an edge case).

            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: