Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1441

DeleteOne does not return any useful information when no document exists

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 1.2.0
    • None
    • None
    • Mac OS Catalina

    Description

      `DeleteOne` method on the collection returns a value of type `*mongo.DeleteResult` which has one attribute `DeletedCount` whose value can either be 0 or 1. It would have been better if there was some way of indicating error when no document was found to be deleted instead of manually checking the `DeletedCount` attribute.

      `DeletedCount` doesn't seem very useful for testing purposes.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            sah.sslpu@gmail.com Deepak Sah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: