Fix findOneAndReplace() upsert test failures for MongoDB 2.4

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • 0.2.0
    • Affects Version/s: 0.2.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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:
            Jeremy Mikola
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: