title: what is the best way to update in mongodb from array object json?
body: <p>i have a json file which has data like this</p>
  <pre><code>[
     {&quot;person_id&quot;: &quot;3455666&quot;, &quot;person_app&quot;: &quot;bjjiu877y&quot;},
     {&quot;person_id&quot;: &quot;5633444&quot;, &quot;person_app&quot;: &quot;rh5556ggg&quot;},
     {&quot;person_id&quot;: &quot;9866654&quot;, &quot;person_app&quot;: &quot;66he4455&quot;},
     ......
  ]
  // length array might 100k - 200k
  </code></pre>
  <p>and in person_collection , i don't have field <code>person_app</code>, and the identifier in person_collection is <code>person_id</code></p>
  <p>i want t update person_collection doc to has person_app</p>
  <p>i was tried with script in js file with</p>
  <pre><code>for( let {person_id, person_app} of dataFromJson) {
    db.person_collection.update({person_id}, {&quot;set&quot;: {person_app}})
  }
  </code></pre>
  <p>i take long time to update and i might dont know if all data is updated, i just want to make sure all data updated at all</p>
  <p>is that any way to update this large data to know that all data updated? and to make it fast?</p>
  <p>thank you</p>