title: Using async loop in mongodb shell for updating many documents
body: <p>I have a problem with the following query in MongoDB shell ONLY when the size of the array gets bigger, for example, more than 100 elements.</p>
  
  <pre><code>newPointArray   --&gt; is an array with 500 elements
  newPointArray.forEach(function(newDoc){
         //update the mongodb properties for each doc
  db.getCollection('me_all_test')
  .update({ '_id': newDoc._id  },
  { $set: { "properties": newDoc.properties } },
  { upsert: true });
  })
  </code></pre>
  
  <p>Can someone guide me how can I run this query IN MongoDB SHELL for lager array by using an async loop or promise or...? </p>
  
  <p>Thanks in advance</p>