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
1
vote
0 answers

Checking the existence of large number of couchbase documents by key

How can I efficiently check the existence of large number of couchbase docs using keys without impacting performance? I would be checking the existence of 300,000 docs in an even much larger couchbase DB. I see the methods provided by couchbase java…
Anmol Garg
  • 113
  • 1
  • 6
1
vote
1 answer

Does couchbase cache or any other cache keeps a String pool like Java does?

I want to store a large number of entries in couchbase cache document. It would be in the following format. [ "6bc2e1db-3082-47b7-894c-85a28c183ab1": [ "fr-FR" .. .. 17 entries ], "dfb348d2-68d1-47b5-8bc8-11178b84df48": [ …
Anmol Garg
  • 113
  • 1
  • 6
1
vote
1 answer

How to handle Couchbase SDK 2 based JsonDocument format usage when migrating to Couchbase SDK 3?

When migrating from Couchbase SDK 2 to SDK 3 certain document formats seem to have been removed. Our current development which was based on Couchbase SDK 2, has extensively used the JsonDocument format…
1
vote
1 answer

NullPointerException when bucket.defaultCollection() is called Couchbase SDK3

Getting NullPointerException when trying the below code public class SalesCouchbaseDao { @Resource private Cluster cluster; @Autowired @Qualifier("salesBucket") private Bucket bucket; private final Logger LOG =…
1
vote
1 answer

Migrating to Couchbase SDK3.2 from 2.7. How to use Flux for it

I am currently having this code to get Couchbase JsonDocument using the below code. I am trying to Migrate to Couchbase SDK3.2 and in 3.2 SDK Obseravable and JsonDocument is not being used. How can i use Flux to achieve the below code ? …
1
vote
0 answers

Couchbase attempt context transaction not working as expected

When there are multiple requests for updating same document in a AttemptContext transaction block, data becomes inconsistent because of concurrent threads trying to update the document. Also a warning…
1
vote
0 answers

Stream N1QL query results in couchbase

My N1QL query returns around 3.5 million documents. Is there a way in which I can stream those documents to the client? I see there is a kafka connector available in couchbase but seems like it works on DCP wherein all the mutations to the documents…
1
vote
0 answers

Spring Data couchbase find by subdocument Element

I have this model: public class Person { @Id String id; @Field Address address; } public class Address { @Id String id; @Field String contry; //.. } I Use this repositry with the N1QL query it's doesn't work. @Collection("personn") public…
1
vote
0 answers

Out of memory error on initializing Couchbase java Client

Facing out of memory error on initializing Couchbase Java Client. The issue happens in the context of running Test cases in the Gradle build. It doesn't seem to be happening when running individual test cases. It seems to be happening on running all…
1
vote
2 answers

How to write a join query which accepts placeholders (query params) using couchbasetemplate from Spring Data Couchbase 4.X version

I need to get a set of data from 2 collections. Employee {"id":"1234", "name":"Smith"} Salary{ "employeeId":"1234", "Salary":"10000"} I am creating an utility method where I have to fetch the data by joining these two tables and pass the…
1
vote
0 answers

How to do batch(update with select) processing in Couchbase by using AsynCluster and without using reactive in couchbase SDK 3.x?

I have a requirement where I want to update 1000 records in the Couchbase and get the ids of the updated record back. I don't want to use Reactive (project reactor) as mentioned in the official document of couchbase SDK 3.x. there is one more…
1
vote
2 answers

Couchbase Java LIKE query giving syntax error - at %!(NOVERB)

Below is the java code: QueryResult result = bucket.defaultScope().query("select * from _default d where d.name like %$nameParam%", QueryOptions.queryOptions() .parameters(JsonObject.create().put("nameParam",…
akash verma
  • 159
  • 1
  • 15
1
vote
1 answer

SpringBoot CouchbaseTemplate: findbyId is working But findByQuery not

Can anyone help me to undersand: In Spring Data Couchbase: spring-data-couchbase : 4.3.0 Couchbase Version: 6.6.2 By using couchbasetemplate findById(Entity.class).one(id) is working fine, I am able to fetch data findByQuery(Entity.class).all()…
1
vote
1 answer

n1ql couchbase, Check last element in array matches a condition

I need to select the record where number value matching the last element in the numbers array in couch base n1ql query Check last element in array matches a condition { name: String, data: { dates: Array, numbers: Array } }
mac
  • 543
  • 1
  • 6
  • 17
1
vote
2 answers

Couchbase APIs, libraries or curl commands to copy data from one cluster to another

I want to copy my data from one cluster of Couchbase to another cluster either via curl commands or using SDK libraries. Could someone please let me know if is there any libraries/APIs available by which I can be do this. We need to copy the data…