So for a document like you proposed (which has an array of objects):
{
"gameInfo" : [
{
"id" : 1,
"name" : "foo"
}
]
}
You would iterate over the elements of the array, then iterate over the elements of the object.json::value& doc = /* fetch your document */;
for (auto& game : doc.at(U("gameInfo")).as_array())
{
for (auto& p : game.as_object())
{
/* use p->first and p->second */
}
}
roschuma