Sandro Rey
Sandro Rey

Reputation: 2989

Spring Data for Couchbase - increments the numerical value of special counter document

I want to increments the numerical value of special counter document, Obtain the id from counter document and increment it

com.couchbase.client.java.Bucket bucket;
JsonLongDocument joCounter = bucket.counter(docKey, 1);

but I don't know how to instantiate the bucket object

Upvotes: 1

Views: 282

Answers (1)

Graham Pople
Graham Pople

Reputation: 516

Our documentation for the Java client shows how to connect to a Couchbase cluster and open a bucket:

https://docs.couchbase.com/java-sdk/current/start-using-sdk.html

Upvotes: 1

Related Questions