When replacing a JSON object embedded in a Couchbase document, is it mandatory to pull the document down to the client first or is there a way to call the bucket’s replace method passing the ID of the document to replace?
// New JSON object of prices
JsonObject newPrices = JsonObject.empty();
newPrices.put(...);
newPrices.put(...);
newPrices.put(...);
// Get document
JsonDocument product = bucket.get(row.id());
product.content().put("prices", newPrices);
// Save
JsonDocument updated = bucket.replace(product);
// Can I do something like this instead?
JsonDocument updated = bucket.replace("prices", newPrices, row.id());