I need a logic code to create the below json structure dynamicaly
<pre><code>{
"2016-01-02": { command: 5, url: "" },
"2015-05-26": { command: 1, url: "" },
"2015-05-03": { command: 2, url: "" },
}
</code></pre>

<p>I need a logic code to create the json structure dynamicaly.</p>

<p>I cerated the JSON with the below code,it is working fine but i need it as a list like the above json structure.</p>

<pre><code>$.each(databaseData, function (ind, val) { 
var dateFormated = val.date; //This data comming from database
var jsonFormatedDate = dateFormated;
jsonFormatedData[jsonFormatedDate] = { "command": val.command, "url":   val.url      }
console.log(jsonFormatedData)
});
</code></pre>

<p>OUTPUT</p>

<pre><code>{
"2016-01-02": { command: 5, url: "" }
}
</code></pre>