title: How to convert NumberDecimal to Double in MongoDB shell?
body: <p>I have a document with "test" filed as <code>NumberDecimal</code> type</p>
  
  <pre><code>{ "_id" : ObjectId("5d1a202e476381c30cd995a4"),  "test" : NumberDecimal("0.1") }
  </code></pre>
  
  <p>How to convert "test" field from <code>NumberDecimal</code> to <code>Double</code> in mongodb shell?</p>
  
  <p>I tried execute </p>
  
  <pre><code>db.collection.find({"test": {$exists: true}}).forEach(function (x) {   x.test = parseFloat(x.test);   db.collection.save(x); });
  </code></pre>
  
  <p>but don't solve this problem because it return NaN</p>