'How update nested object in proto3(DataStore)

I have this proto file

message ProductPreferences {
  string id = 1;
  string name = 2;
  NutritionalValuePreferences nutritionalValue = 3;
}

message NutritionalValuePreferences {
  double calories = 1;
  double proteins = 2;
  double fats = 3;
  double carbs = 4;
}

I can't update nutritional value. When i write code like that it doesn't work.

nutritionalValue.calories = 12.0

But I can update the next fields - id, name



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source