Questions tagged [couchbase-java-api]

The Couchbase Java SDK provides API to working with JSON documents using the Data, N1QL Query, Full-Text Search, Analytics Query and Views Queries available from Couchbase Server.

This Java native client library also has an RxJava based asynchronous API, has built in metrics exposed through an event bus API.

Resources:

172 questions
2
votes
1 answer

Failover and strong consistency in Couchbase

We have a three-node Couchbase cluster with two replicas and durability level MAJORITY. This means that the mutation will be replicated to the active node(node A) and to one of the two replicas(node B) before it is acknowledged as successful. In…
lkatiforis
  • 5,703
  • 2
  • 16
  • 35
2
votes
0 answers

Couchbase SDK 3.x Spring data cache

Whats the recommended way to create CouchBaseCacheManager instance using default Couchbase Collection ? Couldn't find a good code example or description on the web.
2
votes
1 answer

How to store null value document in couchbase with java client v3?

I have a java couchbase client v2 that saves documents to database JsonObject content = ... JsonDocument newDocument = JsonDocument.create(key, expiration, content); bucket.upsert(newDocument); When content is null it saves a 'null-value' document…
Vitalii
  • 10,091
  • 18
  • 83
  • 151
2
votes
2 answers

Couchbase Java SDK times out with BUCKET_NOT_AVAILABLE

I am doing a lookup operation Couchbase Java SDK 3.0.9 which looks like this: // Set up bucket = cluster.bucket("my_bucket") collection = bucket.defaultCollection() // Look up operation val specs =…
Teodor Dimitrov
  • 1,003
  • 2
  • 12
  • 19
2
votes
1 answer

Upserting documents with async bucket on couchbase java sdk 2.7.15

I have the following code that upserts a collection of pojos( to be turned to json documents) into couchbase using Observables: public long batchUpsert(Iterable items, Function docCreator, Bucket couchbaseBucket) { …
Carlos Luis
  • 213
  • 2
  • 17
2
votes
1 answer

How do you control how the Couchbase Java client serializes Dates?

Here's my code (Couchbase Java SDK 3) Cluster cluster = Cluster.connect("localhost", "Administrator", "password"); Collection c = cluster.bucket("default").defaultCollection(); c.upsert("myDocumentId", new Date()); When I look at the resulting…
2
votes
1 answer

Updating multiple documents using Java couchbase SDK

I am using java Couchbase sdk in my application. I want to update same path with same values for multiple documents. For example there is a key X with value Y in all these documents. I want to update the Key X to have the value Z. I am using the…
Kunal gupta
  • 481
  • 2
  • 7
  • 19
2
votes
0 answers

Couchbase : Batch Read Latency

While Couchbase scales well for single key reads, I am observing higher latency when reading batch of 100 keys at a time. Is there a right way to use couchbase-client for batch reads? Currently, the code I have in Scala…
Aparna
  • 463
  • 5
  • 16
2
votes
1 answer

Couchbase metrics sortcount always zero - N1QL + .NET SDK

I need the total no. of records available for the condition to display like - "Page 1 of 'Total Records'" (I'm displaying data in a grid). According to Couchbase forums, sort count metrics should give me the total records but it gives me zero. Any…
Kannan M
  • 570
  • 2
  • 6
  • 19
2
votes
1 answer

Couchbase SDK 3.0 enable/disable flush option from java

I'm trying to enable/disable bucket flush option using below code and it doesn't work. (SDK 3.0) public static void main(String... args) { Cluster cluster = Cluster.connect("host", "user", "password"); cluster.bucket("bucketName").async(); …
Shmuel P.
  • 129
  • 1
  • 8
2
votes
0 answers

understanding the impact of "More than 1 Couchbase Environments found"

I'm trying to understand the true impact of using multiple couchbase environments and the following warning: More than 1 Couchbase Environments found (2), this can have severe impact on performance and stability. Reuse environments! I've done some…
2
votes
1 answer

No index available on keyspace in couchbase

I have a couchbase DB with documents stored, like { "_host": { "kind": "KIND1", "id": "ID1", .. } I have created this index: CREATE INDEX `kind-id-index` ON `dev`(`_host.kind`,`_host.id`) but when I use this…
Sandro Rey
  • 2,429
  • 13
  • 36
  • 80
2
votes
1 answer

How to proceed to next document when DocumentAlreadyExistsException exception is thrown while inserting documents into couchbase using JavaRX?

I'm working on batch job which reads, transforms and writes documents to coucbase. I'm using Java to insert documents in bulk. I don't want to use upsert since I want to log if the document already exist in couchbase and insert is called. Please…
Tech Guy
  • 417
  • 2
  • 7
  • 23
2
votes
1 answer

How to generate unique id with prefix using Spring Data Couchbase SDK?

I would like to know how to generate a unique id with prefix e.g. user::524525 with Couchbase SDK. When I started with Couchbase using the Couchbase JavaSDK guide, I noticed that in all the examples the id looks like TYPE::ID e.g user::king_arthur.…
2
votes
1 answer

Compare and Swap : How to map the cas metadata field to document entity of my couchbase

I am using spring data to fetch documents from couchbase and i need to map the check and set metadata field cas to my document in order to implement the optimistic lock. how can i do it without using n1ql query? CAS reference in Couchbase Thanks
Lho Ben
  • 2,053
  • 18
  • 35
1 2
3
11 12