findAndModify should only return false if there is an error, not missing doc. findAndRemove throws an exception when no record found

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 1.9.0
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • Environment:
      MongoDB 1.6.5
    • Minor Change
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      findAndRemove throws CommandResult.Failure when no record in the collection found. Problems:

      1. Java driver 2.4 returned null in this scenario
      2. The exception has code=-5 which makes it indistinguishable from real errors.

      Test case: https://github.com/alaz/mongo-java-driver/commit/56478bbefdd99fb97a564a449e99772efc08e7b8

              Assignee:
              Mathias Stearn
              Reporter:
              Alexander Azarov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: