title: Updating metadata for gridfs file object
body: <p>I use GridFS as follows:</p>
  
  <pre><code>connection = MongoClient(host='localhost')
  db = connection.gridfs_example
  fs = gridfs.GridFS(db)
  fileId = fs.put("Contents of my file", key='s1')
  </code></pre>
  
  <p>After files are originally stored in GridFS, I have a process that computes additional metadata respective to the contents of the file. </p>
  
  <pre><code>def qcFile(fileId):
      #DO QC
      return "QC PASSED"
  
  qcResult = qcFile(fileId)
  </code></pre>
  
  <p>It would have been great if I could do:</p>
  
  <pre><code>fs.update(fileId, QC_RESULT = qcResult)
  </code></pre>
  
  <p>But that option does not appear to exist within the documentation. I found <a href="https://stackoverflow.com/questions/29515327/how-to-perform-update-operations-in-gridfs-using-java">here</a> (the question updated with solution) that the Java driver appears to offer an option to do something like this but can't find its equivalent in python gridfs.</p>
  
  <p>So, how do I use pymongo to tag my file with the newly computed metadata value <code>qcResult</code>? I can't find it within the <a href="http://api.mongodb.com/python/current/api/gridfs/" rel="nofollow noreferrer">documentation</a>.</p>