Couchbase Questions: Java SDK

Have a Question? Get it answered by our community

coder_lol's picture
Asked 1 year 1 month ago
Latest activity 1 year 1 month ago

get versus getAndTouch

Couchbase 2.0.1 Java client 1.1.7
We have noticed that, at times, getAndTouch, would not return our object even though we can confirm the object exists using the built-in Web Console.
By definition, getAndTouch may not return the object, perhaps, due to, among many reasons,...

coder_lol's picture
Asked 1 year 2 months ago
Latest activity 11 months 2 weeks ago

Couchbase 2.0.1 Mapping of Plain Java String

Couchbase Enterprise / Community 2.0.1
Java SDK 1.1.5 / 1.1.7
client.add("myKey", "34.0");
The Couchbase console "Documents" view showed the value as "34". This case perplexes me. Why? Compare to another case below...
client.add("myKey", "6S.0");
The Couchbase...

cadams's picture
Asked 1 year 2 months ago
Latest activity 1 year 2 months ago

Return CASValue on initial set Java SDK 1.1.5 (updated question)

Is there a way to do an initial set with CAS and return a CASValue without having to do an add or set followed by a gets()?

Perhaps there is a util to generate an initial long unique cas id?

coder_lol's picture
Asked 1 year 2 months ago
Latest activity 1 year 2 months ago

Couchbase 2.0.1 and Java 1.1.7 rangeStart Bug?

Couchbase Enterprise / Community 2.0.1
Java SDK 1.1.5 / 1.1.7

There seems to be a problem setting rangeStart, rangeEnd using ComplexKey or JSON string directly.

Here is the output from ComplexKey.of(startKey)

ComplexKey.of(startKey)="5yc38"

Here is the debug...

rkb's picture
Asked 1 year 4 months ago
Latest activity 1 year 4 months ago

Query options

In Java there are methods for setting the start and end document ID key (setStartkeyDocID() setEndkeyDocID()) and there are methods to set the key (setKey() and setKeys()) and key range (setRange(), setRangeStart(), setRangeEnd(), etc.). I am unclear as to the difference? When I setup a view the...

rkb's picture
Asked 1 year 4 months ago
Latest activity 1 year 1 month ago

Create a design document with Java?

How do I create a design document (or for that matter a view) using the Java API?
I found this link http://www.couchbase.com/docs/couchbase-sdk-java-1.1/couchbase-sdk-java-... but it doesn't explain what...

rkb's picture
Asked 1 year 4 months ago
Latest activity 1 year 2 months ago

Number of buckets must be a power of two?

I am getting this error:
Exception in thread "main" com.couchbase.client.vbucket.config.ConfigParsingException: Number of buckets must be a power of two, > 0 and Either I am doing something wrong or this is a very restrictive requirement. I can see that if I have 4 buckets it is not...

rkb's picture
Asked 1 year 4 months ago
Latest activity 1 year 4 months ago

CRUD for a bucket?

I see in the example (Java SDK) that a client is created like:
client = new CouchbaseClient(uris, "default", "");
This uses the "default" bucket. But what if the "default" bucket doesn't exist? How is a bucket created? How do you detect if the bucket exists? How is it removed? How...

rkb's picture
Asked 1 year 4 months ago
Latest activity 1 year 4 months ago

Maven project dependencies

I would like to use a maven project to include the Java Driver for CouchBase. I can see when I click on the Maven hyperlink that I am taken to basically a folder structure. What do I need to include in pom.xml to start using the Couchbase Java driver?
Thank you.

shahshi15's picture
Asked 1 year 6 months ago
Latest activity 1 year 5 months ago

JAVA SDK 1.1 - ArrayOutOfBoundException when using client.add with persistTo.MASTER

Hi, Greetings ! I am a new developer with Couchbase SDK and I was trying a basic .add method to add a document to Couchbase. I have setup my Couchbase server mostly as per the default instructions. Here's the code block
try
{
client.add("foo", expireTime, "...

Pages