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

DeleteOne does not return any useful information when no document exists

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.2.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OS Catalina

      `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.

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

              Created:
              Updated:
              Resolved: