title: Constantly getting DuplicateKeyError with pymongo
body: <p>Pymongo was doing fine for weeks until I ran into the following error:</p>
  <pre>
  
      Traceback (most recent call last):
        File "main.py", line 14, in 
          main()
        File "main.py", line 11, in main
          downloader.process()
        File "/mnt/vdisk/crawler/eurostat/downloader.py", line 25, in process
          self.processHelper()
        File "/mnt/vdisk/crawler/eurostat/downloader.py", line 61, in processHelper
          self.base.insert(documents)
        File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 359, in insert
          continue_on_error, 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 793, in __check_response_to_last_error
          raise DuplicateKeyError(details["err"])
      pymongo.errors.DuplicateKeyError: E11000 duplicate key error index: test.eurostatdata.$_id_  dup key: { : ObjectId('50fd056757b924675af21a0e') }
  
  </pre>
  <p>_id was definitely not one of the field. I always rely on mongodb to generate its own _id, so I never had this kind of problem before.</p>
  <p>code for insertion:</p>
  <pre>
  
  documents = []
  for key in split_table_data:
      document = ele
      document["title"] = ele["title"]
      document["table_data"] = split_table_data[key]
      document["cols"] = colsHeader
      document["subTitles"] = key
      documents.append(document)
  self.base.insert(documents)
  
  </pre>
  <p>I use the latest pymongo package and the latest mongodb.</p>
  <p>The only thing that might have caused this would be that I tried to insert a document that was over the size limit.</p>
  <p>I have tried</p>
  <blockquote>
  <p>db.repairDatabase()</p>
  <p>db.test.validate()</p>
  </blockquote>