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

BulkWrite::insert() does not generate ObjectID if another field has "_id" prefix

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

      When phongo_zval_to_bson() checks whether an "_id" field should be injected (for insertions), it uses strncmp() and limits the comparison to three characters. This means it will skip "_id" injection if another field has an "_id" prefix, which ultimately puts the onus the server to generate an ID for the document.

            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: