title: Append new value to a list in PyMongo
body: <p>I have a collection in MongoDB that I store on mlab like this</p>
  
  <pre><code>{
     'course_id': '...',
     'course_description: '...',
     'reviews:' [
        {
           'hours': ...
           'review': ...
        },
        {
           'hours': ...
           'review': ...
        }
      ]
  }
  </code></pre>
  
  <p>I'm having trouble appending new values to the <code>list_to_append</code> above. None of these methods below works for me. I'm using PyMongo (version 2.8) to interact with MongoDB.</p>
  
  <p>Here is the code snippet that I'm using to update the list </p>
  
  <pre><code>@app.route('/', methods=['GET', 'POST'])
  def index():
      search_form = SearchBar()
      if request.method == 'GET':
          review_dict = {'hours': "5 hours", 'review': "Something something"}
  
          # Test with one collection and one course first
          mongo.db['CS'].update({'course_id:': 'CS 101'}, {'$push': {'reviews:': review_dict}})
          return render_template('index.html', form=search_form)
  </code></pre>
  
  <p>I've tried these methods below but they didn't work for me.</p>
  
  <p><a href="https://stackoverflow.com/questions/33189258/append-item-to-mongodb-document-array-in-pymongo-without-re-insertion">Append item to MongoDB document array in PyMongo without re-insertion</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13987365/how-to-insert-an-element-to-mongodb-internal-list">How to insert an element to MongoDB internal list?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17674352/inserting-items-in-list-in-mongodb-document">inserting items in list in mongodb document</a></p>