lundi 19 février 2018

How do you append objects in Folly Dynamic?

How do you append values in to the dynamic object?

If I do this :

osnMetrics["something"] = folly::dynamic::object("yet", 25);
osnMetrics["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

Aucun commentaire:

Enregistrer un commentaire