title: Mongodb bulk write error
body: <p>I'm executing bulk write </p>
  
  <p><code>bulk = new_packets.initialize_ordered_bulk_op()</code></p>
  
  <p><code>bulk.insert(packet)</code></p>
  
  <p><code>output = bulk.execute()</code></p>
  
  <p>and getting an error that I interpret to mean that packet is not a dict. However, I do know that it is a dict. What could be the problem?</p>
  
  <p>Here is the error:</p>
  
  <pre><code>    BulkWriteError                            Traceback (most recent call last)
      &lt;ipython-input-311-93f16dce5714&gt; in &lt;module&gt;()
            2 
            3 bulk.insert(packet)
      ----&gt; 4 output = bulk.execute()
  
      C:\Users\e306654\AppData\Local\Continuum\Anaconda\lib\site-packages\pymongo\bulk.pyc in execute(self, write_concern)
  583         if write_concern and not isinstance(write_concern, dict):
  584             raise TypeError('write_concern must be an instance of dict')
      --&gt; 585         return self.__bulk.execute(write_concern)
  
      C:\Users\e306654\AppData\Local\Continuum\Anaconda\lib\site-packages\pymongo\bulk.pyc in execute(self, write_concern)
  429             self.execute_no_results(generator)
  430         elif client.max_wire_version &gt; 1:
      --&gt; 431             return self.execute_command(generator, write_concern)
  432         else:
  433             return self.execute_legacy(generator, write_concern)
  
      C:\Users\e306654\AppData\Local\Continuum\Anaconda\lib\site-packages\pymongo\bulk.pyc in execute_command(self, generator, write_concern)
  296                 full_result['writeErrors'].sort(
  297                     key=lambda error: error['index'])
      --&gt; 298             raise BulkWriteError(full_result)
  299         return full_result
  300 
  
      BulkWriteError: batch op errors occurred
  </code></pre>