Add a field into capped collection in MongoDB
<p>I created a capped collection to store my log data with few fields. Due to some requirement I wanted to add an additional field named "createAt" in this collection.</p>

<pre><code>db.myLogs.update({},{$set: {"createAt":new Date()}})
</code></pre>

<p>This is throwing below error:</p>

<pre><code>WriteResult({
        "nMatched" : 0,
        "nUpserted" : 0,
        "nModified" : 0,
        "writeError" : {
                "code" : 10003,
                "errmsg" : "Cannot change the size of a document in a capped collection: 39 != 57"
        }
})
</code></pre>

<p>How can I add a few field into capped collection?</p>