DESCRIPTION

JCBC-784: Allow to explicitly check for not existing document on counter.

Motivation
----------
Currently, there is no way to fail if the counter document does not exist
at all. In the "old" SDK, this option was available.

Since conditionally incrementing or decrementing a counter only when it
exists has its use cases, this functionality should be provided again.

Modifications
-------------
The overload with no initial value now does not forward to "0" intial,
but utilizes the protocol level semantics to set the expiry to 0xffffffff
which will return a NOT_EXISTS on the server if the document does not
exist.

This status is now explicitly translated into an exception, leading into
the wanted DocumentDoesNotExistException. Tests have been adapted
properly.

While this is not an API breaking change, it changes behaviour, but
the benefits outweigh the potential breakage (the workaround is to
just manually set 0 as the initial value).

Result
------
The SDK now exposes a proper way to deal with non-existing
documents for the counter operation.

Change-Id: Ie473cb6c3d77d385f144416fd724024c12de2d90
Reviewed-on: http://review.couchbase.org/52276
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Tate Garrett
date: 2015-06-19 15:44:33.866000000

Change has been successfully cherry-picked as 3961b6df7ca1676f3180a1bafd17900bc1e8c6e3

-------------------------------------
