1

How do you append values in to the dynamic object?

If I do this :

Metrics["something"] = folly::dynamic::object("yet", 25);
Metrics["something"] = folly::dynamic::object("Notyet", 255);

I am getting

{
 "something" : {
    "Notyet" : 255
  }
}

Since I am iterating values and adding keys and values into it as I go, How Do I get

{
 "something" : {
    "Notyet" : 255,
    "yet" : 25
  }
}

I looked around, I do not see an append method, there is support for adding multiple values at the time of creation, but I need it to do it over iteration

ajax_velu
  • 286
  • 3
  • 16

1 Answers1

0

More intutive than appends:

Metrics["something"] = folly::dynamic::object;
Metrics["something"]["yet"] = 25;
Metrics["something"]["Notyet"] = 255;
ajax_velu
  • 286
  • 3
  • 16