title: update commands works via mongo shell but not via pymongo
body: <p>I'm trying to update an array inside a mongo document by using <code>pymongo</code> but it is not working, but copy same query to robomongo does works.
  (it returns <code>{'n': 1, 'nModified': 0, 'ok': 1.0, 'updatedExisting': True}</code>)</p>
  
  <p>roboMongo:</p>
  
  <pre><code>db.my_collection.updateMany(
      {'start_time': 1501700400.0},
      {'$pull': {'related': {'$in': [{'KEY': '1', 'TYPE': 'my_type'}]}}},
      {upsert:true}
  )
  </code></pre>
  
  <p>pymongo code:</p>
  
  <pre><code>query_document = {'start_time': 1501700400.0}
  update_command = {'$pull': {'related': {'$in': [{'KEY': '1', 'TYPE': 'my_type'}]}}}
  _client[db][collection].update_many(query_document, update_command, True)
  </code></pre>
  
  <p>document:</p>
  
  <pre><code>{
      "_id" : ObjectId("598570c4ffd387293e368c8d"),
      "related" : [ 
          {
              "KEY" : "6",
              "TYPE" : "my_type"
          }, 
          {
              "KEY" : "2",
              "TYPE" : "my_type"
          }, 
          {
              "KEY" : "3",
              "TYPE" : "my_type"
          }, 
          {
              "KEY" : "5",
              "TYPE" : "my_type"
          }, 
          {
              "KEY" : "8",
              "TYPE" : "my_type"
          }
      ],
      "end_time" : 1501621200.0,
      "start_time" : 1501700400.0
  }
  </code></pre>
  
  <p>I'm thinking maybe it is related to " and ' ? </p>
  
  <p>any advice?</p>
  
  <p>Thanks</p>