title: MongoDB Shell Script Update all field Names where there is space in field name
body: <p>Using <code>MongoDB</code> shell script 3.2, how can I update all fields where field names have a <code>space replace those with underscore</code>?</p>
  
  <pre><code>{
  "Some Field": "value",
  "OtherField" :"Value",
  "Another Field" : "Value"
  }
  </code></pre>
  
  <p>update the above document as below </p>
  
  <pre><code>{
  "Some_Field": "value",
  "OtherField" :"Value",
  "Another_Field" : "Value"
  }
  </code></pre>
  
  <p>rename field can be done with something like this</p>
  
  <pre><code>db.CollectionName.update( { _id: 1 }, { $rename: { 'nickname': 'alias', 'cell': 'mobile' } } )
  </code></pre>
  
  <p>Challenging part here is <code>filter</code>, how to come up with a <code>filter</code> where there is a space in field name</p>