strange problems with increment
I'm running the following code on couchbase 2.5.1 and java sdk versions 1.3.2 and 1.4.2
bucket.couchbaseClient.set("incrementInt4", 4).get() mustEqual true bucket.couchbaseClient.set("incrementInt", 3).get() mustEqual true System.out.println(bucket.couchbaseClient.get("incrementInt4").toString) System.out.println(bucket.couchbaseClient.get("incrementInt").toString) //STRANGE incr does not seem to work, counter is not incremented bucket.couchbaseClient.incr("incrementInt", 1) System.out.println(bucket.couchbaseClient.get("incrementInt").toString)
Its scala, which explains the lack of ';'
I get the following output from the console
I would expect the last line to be 4. Also the incr returns -1, which means that the key did not exist, according to the reference documentation
In the ui for couchbase, the keys has the following values
incrementInt "Aw==" incrementInt4 "BA=="
Why are the keys not stored as integers. I can't get the above to make sense
Can you either do a incr with a default value or set with the number as a string?
Also, the user interface only shows you JSON nicely, which is not the case for a number that you are handling with incr/decr.