MongoDB : how to set a new field equal to the value of another field, for every document in a collection
<p>I need to run a migration script to insert a value (already available in each document) into an array of this same document. This has to be done for each documents of my collection (no selection query required)</p>

<p>How to change this:</p>

<pre><code>{
    "_id": ObjectID("5649a7f1184ebc59094bd8b3"),
    "alternativeOrganizer": ObjectID("5649a7f1184ebc59094bd8b1"),
    "myArray": []
}
</code></pre>

<p>Into this:</p>

<pre><code>{
    "_id": ObjectID("5649a7f1184ebc59094bd8b3"),
    "alternativeOrganizer": ObjectID("5649a7f1184ebc59094bd8b3"),
    "myArray": [
         ObjectID("5649a7f1184ebc59094bd8b3")
    ]
}
</code></pre>

<p>Thanks in advance.</p>