title: Update all MongoDB fields with their own values with PyMongo
body: <p>I want to update every field of my MongoDB collection using the field's own value to do so.</p>
  
  <p>Example: if I have this document: <code>"string": "foo"</code>, a possible update would do this: <code>"string": $string.lower()</code>. Here, <code>$string</code> would be <code>"foo"</code>, but I don't know how to do this with PyMongo.</p>
  
  <p>I've tried this:</p>
  
  <pre><code>user_collection.update_many({}, { "$set": { "word": my_func("$word")}})
  </code></pre>
  
  <p>Which replaces everything with <code>"$word"</code>.</p>
  
  <p>I've been able to do it successfully iterating each document but it takes too long.</p>