Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-96

Fix findOneAndReplace() upsert test failures for MongoDB 2.4

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.2.0
    • Affects Version/s: 0.2.0
    • Component/s: None
    • None

      The following tests fail on 2.4:

      When asserting the collection outcome, the newly upserted document contains a generated ObjectId instead of 4. Evidently, findAndModify on 2.4 and earlier disregards the filter when it yields no match and an upsert is requested with a full replacement document (i.e. no atomic operators). The issue seems specific to dealing with replacement documents, as the corresponding findOneAndUpdate() tests do not have this issue.

      A work-around would entail duplicating the ID in our replacement document.

            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: