Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1440

bucket.defaultCollection().exists("someKey") throws Exception if document does not exist

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 3.0.0-beta.1
    • 3.0.0-alpha.7
    • None
    • None
    • 1

    Description

       Calling bucket.defaultCollection().exists("someKey") with a key that doesn't exists throws an exception KeyNotFoundException. 

      This behavior feels a little bit awkward as I have to encapsulate the code with a try-catch, which totally defuse the purpose of the "exist" method. I this case I can simply go ahead and use the get method directly.

      From my point of view, the exists method should return an object|boolean saying if the document has been found or not instead of throwing an exception.

       

       

       

      Attachments

        Activity

          People

            daschl Michael Nitschinger
            denis.rosa Denis Rosa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty