Counter
class Counter
Content copied to clipboard
A counter backed by a document on Couchbase Server.
Counter operations are atomic with respect to a single Couchbase Server cluster, but not between clusters when Cross-Datacenter Replication (XDCR) is used.
The content of a counter document is a single JSON integer with a minimum value of zero and a maximum value of 2^64 - 1.
A counter decremented below zero is reset to zero.
A counter incremented above 2^64 - 1 overflows (wraps around).
Counter values above 2^53 - 1 may have interoperability issues with other languages that store all numbers as floating point values.
See also
Functions
decrementAndGet
Link copied to clipboard
incrementAndGet
Link copied to clipboard
set
Link copied to clipboard
Properties
collection
Link copied to clipboard
common
Link copied to clipboard
documentId
Link copied to clipboard
durability
Link copied to clipboard