title: How to iterate through json objects with cpprest
body: <p>I have a "jvalue" variable that holds a json data:</p>
  
  <pre><code>{
      "data": [
          {
              "_id": 123,
              "name": "Name 1"
          },
          {
              "_id": 124,
              "name": "Name 2"
          }  
      ],
      "success": true
  }
  </code></pre>
  
  <p>This is my code that i tried:</p>
  
  <pre><code>auto data = jvalue.at(U("data")).at(0);
  auto dataObj = data.as_object();
  
  for (auto iterInner = dataObj.cbegin(); iterInner != dataObj.cend(); ++iterInner)
  {
      auto &amp;propertyName = iterInner-&gt;first;
      auto &amp;propertyValue = iterInner-&gt;second;
  
      std::wcout &lt;&lt; "Property: " &lt;&lt; propertyName &lt;&lt; ", Value: " &lt;&lt; propertyValue &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>But it displays the first set of data only:</p>
  
  <pre><code>Property: _id, Value: 123
  Property: name, Value: "Name 1"
  </code></pre>
  
  <p>I know I'm missing something here, but the idea won't pop up to my mind.
  Maybe something like double for loop.</p>
  
  <p>Can anybody share an idea to this. Thank you.</p>