I try to update an array element using MongoDB Java driver API method com.mongodb.client.model.Updates.set
like this:
set(String.format("bag.items[%d]", idx), old.map(mo -> mo.frozen).orElse(null))
But instead of updating, the Item it creates a new field with the name "items[0]"
the correct syntax is
set(String.format("bag.items.%d", idx), old.map(mo -> mo.frozen).orElse(null))