@Override
    protected void checkCompatibility(DataType fieldType) {
        if (fieldType instanceof ArrayDataType) {
            if (!(value instanceof IntegerFieldValue)) {
                throw new IllegalArgumentException("Expected integer, got " + value.getClass().getName() + ".");
            }
            update.checkCompatibility(((ArrayDataType)fieldType).getNestedType());
        } else if (fieldType instanceof WeightedSetDataType) {
            ((WeightedSetDataType)fieldType).getNestedType().createFieldValue().assign(value);
            update.checkCompatibility(DataType.INT);
        } else if (fieldType instanceof StructuredDataType) {
            if (!(value instanceof StringFieldValue)) {
                throw new IllegalArgumentException("Expected string, got " + value.getClass().getName() + ".");
            }
            Field field = ((StructuredDataType)fieldType).getField(((StringFieldValue)value).getString());
            if (field == null) {
                throw new IllegalArgumentException("Field '" + value + "' not found.");
            }
            update.checkCompatibility(field.getDataType());
        } else {
            throw new UnsupportedOperationException("Field type " + fieldType.getName() + " not supported.");
        }
    }
Sets the key of the nested update
document/src/main/java/com/yahoo/document/update/MapValueUpdate.java