Linked Questions

Popular Questions

I am using Couchbase java SDK to read and write data. Currently I am having large number of records which need to be saved in Couchbase. These records contains both new or existing one.

I am using Bucket.upsert for this functionality. But I also need to capture that how many records are created or updated into Couchbase.

How to achieve this effectively? The following is my pseudo code that I am having now

JsonDocument doc = bucket.get("docId")
if (doc != null) {
    // Perform update
    updatedCount++;
} else {
    // perform insert
    insertedCount++;
}

Any thought to do this better way. Because I am having more than 500k records to save into Couchbase.

Related Questions