I am currently trying to run the following query through the java sdk.
//just filtering the keys and putting them in a jsonArray List<String> keys; JsonAray jsonArray; = JsonArray.create(); keys.stream().filter(docId!=null && !docId.isEmpty()).forEach(docId ->jsonArray.add(docId))); //setting up the query and positional parameters String query = "UPDATE `bucket` USE KEYS $1 SET status= $2" QueryOption 10 = QueryOption.queryOptions().parameters(JsonArray.from(jsonArray,"status"); QueryResult result = cluster.query(query,qo) return result.metaData().metrics().get().mutationCount();
When I run this, I am getting a java.util.NoSuchElementException: No value present when trying to access the mutationCount even though the query runs without failing (but the update doesn’t work either way since when I check the doc the status remains unchanged). What is wrong with my update statement?
As a follow up, is the only difference between using something like “USE KEYS keys” vs where docId IN keys a matter of performance?