title: Upsert and Multi flag in pymongo
body: <p>I am working on pymongo and this is my document:</p>
  
  <pre><code>{
     "_id": ObjectId("51211b57f07ddaa377000000"),
     "assignments": {
       "0": {
         "0": {
           "_id": ObjectId("5120dd7400a4453d58a0d0ec") 
        },
         "1": {
           "_id": ObjectId("5120dd8e00a4453d58a0d0ed") 
        },
         "2": {
           "_id": ObjectId("5120ddad00a4453d58a0d0ee") 
        } 
      } 
    },
     "password": "my_passwd",
     "username": "john" 
  }
  </code></pre>
  
  <p>I would like to unset the "assignment" property of all such docs.
  I was able to achieve this on the mongo shell by doing:</p>
  
  <pre><code>db.users.update({}, {$unset: {"assignments": 1}}, false, true)
  </code></pre>
  
  <p>i.e., I passed the upsert and multi flag as the last two parameters to the update function function on users collection.
  However I did this with pymongo:</p>
  
  <pre><code>db.users.update({}, {"$unset": {"assignments": 1}}, False, True)
  </code></pre>
  
  <p>But the python interpreter threw an error as follows:</p>
  
  <pre><code>File "notes/assignment.py", line 34, in &lt;module&gt;
      db.users.update({}, {"$unset": {"assignments": 1}}, False, True)
    File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 481, in update
      check_keys, self.__uuid_subtype), safe)
    File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 852, in _send_message
      rv = self.__check_response_to_last_error(response)
    File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 795, in __check_response_to_last_error
      raise OperationFailure(details["err"], details["code"])
  pymongo.errors.OperationFailure: Modifiers and non-modifiers cannot be mixed
  </code></pre>
  
  <p>Where am I going wrong?</p>