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

Incrementing a non-existent counter creates an empty document

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • 3.0.1
    • None
    • None
    • None
    • 1

    Description

       

      public static void main(String[] args) {
        Cluster cluster = Cluster.connect("localhost", "Administrator", "password");
        Collection c = cluster.bucket("default").defaultCollection();
        c.binary().increment("nonExistentDocument",
            IncrementOptions.incrementOptions().initial(0));
      } 

       

      Expected behavior: document is created with  value 0.

      Observed behavior: empty document is created.

       

      Running the example program again results in a the document value being set it 1... it seems like it's only the initial counter access that results in an empty document..

      Attachments

        1. Screenshot 2020-01-30 at 10.58.42.png
          55 kB
          Michael Nitschinger
        2. Screenshot 2020-01-30 at 11.25.52.png
          61 kB
          Michael Nitschinger

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              daschl Michael Nitschinger
              david.nault David Nault
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty