title: Python / Dictionary / List / Mongo insert issues - beginner
body: <p>Sorry, trying to understand and get used to dictionary and list objects.  </p>
  
  <p>I'm calling eBay's API through their ebaysdk, and want to store the items from it to a collection as documents in Mongo.  Simple.</p>
  
  <p>Here's a sample of the schema that will be returned:</p>
  
  <pre><code>&lt;timestamp&gt;2009-09-04T00:47:12.456Z&lt;/timestamp&gt;
    &lt;searchResult count="2"&gt;
    &lt;item&gt;
       &lt;itemId&gt;230371938681&lt;/itemId&gt;
       &lt;title&gt;Harry Potter and the Order of the Phoenix HD-DVD&lt;/title&gt;
       &lt;globalId&gt;EBAY-US&lt;/globalId&gt;
       &lt;primaryCategory&gt;
          &lt;categoryId&gt;617&lt;/categoryId&gt;
          &lt;categoryName&gt;DVD, HD DVD &amp; Blu-ray&lt;/categoryName&gt;
       &lt;/primaryCategory&gt;
  </code></pre>
  
  <p>I've tried 500 iterations of this code, stripped down to the most basic here's what I have.</p>
  
  <pre><code>from ebaysdk import finding
  from pymongo import MongoClient
  
  api = finding(appid="billy-40d0a7e49d87")
  api.execute('findItemsByKeywords', {'keywords': 'potter'})
  listings = api.response_dict()
  
  client = MongoClient('mongodb://user:pass@billy.mongohq.com:10099/ebaystuff')
  db = client['ebaycollection']
  ebay_collection = db.ebaysearch
  
  for key in listings:
    print key
    ebay_collection.insert(key)
  </code></pre>
  
  <p>Will get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "ebay_search.py", line 34, in &lt;module&gt;
      ebay_collection.insert(key)
    File "/Library/Python/2.7/site-packages/pymongo/collection.py", line 408, in insert
      self.uuid_subtype, client)
    File "/Library/Python/2.7/site-packages/pymongo/collection.py", line 378, in gen
      doc['_id'] = ObjectId()
  TypeError: 'str' object does not support item assignment
  </code></pre>
  
  <p>Simple stuff.  All I want to do is add each item as a document.</p>