Update multiple documents at once

I want to do something like this:

UPDATE TABLE SET can_move=false WHERE category_code='CVR';

I have done the following so far but not sure if it is write:

           Query query = QueryBuilder

      try {
    ResultSet rs = query.execute();
 database.inBatch(() -> {
    for (Result result : rs) {
        String id = result.getString('id');
       // get the document to update now
        MutableDocument doc = database.getDocument(id).toMutable();
} catch (CouchbaseLiteException e) {
    throw e;

Am i doing it right? I couldn’t find a concrete example (sorry if i missed it).

I don’t understand catching the exception and then re-throwing it. Other than that, it looks plausible.

Does it do what you intend? Is there a problem?