title: Updating mongo docs to convert int to decimal type
body: <p>I have a collection of Mongo docs that have a nested property as type Int32. I want to update all documents in situ by converting that field to a type of Decimal.</p>
  <p>This is my code so far</p>
  <pre><code>var myCollection = 'Items';
  var count = 0;
  
  db.getCollection(myCollection).find({}).forEach(item =&gt; {
      item.Request.Children.forEach(child =&gt; {
          child.Size = {$toDecimal: child.Size};
      });
      
      db.getCollection(myCollection).update({ _id: item._id }, item);
  });
  </code></pre>
  <p>But I get the error</p>
  <blockquote>
  <p>Error: field names cannot start with $ [$toDecimal]</p>
  </blockquote>