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
3
votes
1 answer

get vs getAllReplicas vs getAnyReplicas in couchbase

Couchbase java sdk exposes 3 methods. getAllReplicas and getAnyReplicas are pertinent when master is down. In General what strategy should be chosen while calling Couchbase for HA setup.
best wishes
  • 5,789
  • 1
  • 34
  • 59
3
votes
1 answer

In Couchbase is it possible to set and get XATTR value for non JSON documents?

I put binary data in Couchbase. But for my new use case, I need to set a field called created_date along with my document. I was thinking of using xattr for this. The purpose of this field "created_date" will be to use it for comparison between two…
Yash Agarwal
  • 955
  • 1
  • 13
  • 28
3
votes
0 answers

Ignore PathNotFoundException during mutations using Java couchbase SDK

I am using java couchbase sdk in my application. I am using AsyncMutateInBuilder for doing mutations. Now when i upsert a mutation or try to remove a path which doesn't exist in the document, I get PathNotFoundException which makes sense. While…
Kunal gupta
  • 481
  • 2
  • 7
  • 19
3
votes
1 answer

Spring Data for Couchbase: use of AND ANY ... SATISFIES

I have a SpringBoot 2 app that uses using Couchbase as a database, Spring-Boot and Spring-Data and Lombok fot the getters and equals method I have created this Repository @ViewIndexed(designDoc = "bendicionesDoc") public interface BenRepository…
3
votes
2 answers

Spring Data for Couchbase - Counting element in the DB

I am new using Spring Data for Couchbase, I defined this object public class Building { @NotNull @Id private String id; @NotNull @Field private String name; @NotNull @Field private String companyId; } I want…
3
votes
1 answer

How to get CAS value while performing an update using couchbase subdocument api?

I want to perform update on documents. I am using couchbase subdocument api to update the documents. While performing the update,I only have the document id at hand. However to get the current Cas value I have to perform a get to the couchbase. My…
3
votes
1 answer

Couchbase bulk subdocument operation

I am using Couchbase-Java SDK 2.7.1 and trying to perform bulk subdoc operation on the set of document keys. The below code is not throwing any error but the documents aren't getting updated after the execution of the given code. /* Document…
Ashwin
  • 993
  • 1
  • 16
  • 41
3
votes
2 answers

Case insensitive document ID matching in Couchbase

I'm using com.couchbase.client maven dependency in java spring project. I fetch a couchbase document from code in following way: JsonDocument document = bucket.get(id); //matches id case sensitively But i've got a new requirement. I have to fetch…
3
votes
1 answer

Couchbase client trying to connect to localhost while configured to remote server

I am trying to run a simple code, which opens a bucket on remote Couchbase 5.1 server using Java SDK 2.6.2 and inserts a document. Cluster cluster = CouchbaseCluster.create("192.168.111.10"); cluster.authenticate("user", "password"); …
Alex
  • 133
  • 3
  • 12
3
votes
4 answers

How to create and publish Index using Java Client Programatically

Is it possible to programmatically create and publish secondary indexes using Couchbases Java Client 2.2.2? I want to be able to create and publish my custom secondary indexes Running Couchbase 4.1. I know this is possible to do with Couchbase Views…
Marquis Blount
  • 7,585
  • 8
  • 43
  • 67
3
votes
2 answers

What is the Equvalent N1ql query for inserting the document in the couchbase

The following query is for fetching the documents from the couchbase while working with Java_client N1qlQueryResult result = bucket.query(N1qlQuery.simple( "SELECT * FROM `default;")); How to write the statement to insert the…
M.S.Naidu
  • 2,239
  • 5
  • 32
  • 56
3
votes
2 answers

Couchbase server connection is giving an authentication error

All I want to do is to do an upsert operation. I have a JsonDocument and I have a Couchbase server "123.456.789.1011" and a bucket inside, called "testbucket". Now, when I open the server using the IP address with port 8091, it asks me for a…
Vikash Kumar
  • 87
  • 2
  • 11
3
votes
1 answer

How do I create a View from couchbase Java sdk 2.1

I need to create a view with a map function ex: function(doc, meta) { if(doc.docType == "testDoc") emit(meta.id, doc) } I have to create this view using couchbase java client 2.1.I could not find any thing in the documentation thanks
jsphdnl
  • 415
  • 6
  • 21
2
votes
0 answers

Preferred method to format logs from the Couchbase tracing package?

By default, all the logs from the tracing package (such as com.couchbase.tracing][OverThresholdRequestsRecordedEvent) are JSON documents such as { "kv": { "top_requests": [ { "operation_name": "get", …
Yeikel
  • 854
  • 10
  • 18
2
votes
1 answer

Create Admin User using Couchbase Java SDK

I am figuring out the couchbase java SDK 3.3 and how to manage users. Using the User Management documentation, I can run this snippet of code: # Example Read Only User User user = new User(testUsername).password(userPassword); user.roles(new…
GrimThor3
  • 171
  • 1
  • 10
1
2
3
11 12