Description
It looks like the new UI treats a counter document with a value 0 as empty.
See
In the old ui (I checked on 5.5) it looks fine displayed as 0:
Code to reproduce:
System.err.println(collection.binary().increment(UUID.randomUUID().toString(), IncrementOptions.incrementOptions().initial(0)));
|
System.err.println(collection.binary().increment(UUID.randomUUID().toString(), IncrementOptions.incrementOptions().initial(1)));
|
KV engine accepts both fine:
CounterResult{cas=0x15eea32b64bb0000, mutationToken=Optional[mt{vbID=177, vbUUID=68327101389634, seqno=1, bucket=meta}], content=0}
|
CounterResult{cas=0x15eea32b65000000, mutationToken=Optional[mt{vbID=848, vbUUID=158240136640219, seqno=1, bucket=meta}], content=1}
|
Also a quick crosscheck from cbc shows the 0 is not empty but has a size:
cbc cat -u Administrator -P password -U couchbase://10.143.186.101/meta 81dcf4f3-984c-4b96-a51a-0b61140255fc
|
81dcf4f3-984c-4b96-a51a-0b61140255fc CAS=0x15eea32b64bb0000, Flags=0x0, Size=1, Datatype=0x00
|
0
|
Attachments
Issue Links
- is triggered by
-
JCBC-1579 Incrementing a non-existent counter creates an empty document
- Resolved