title: Update model with Mongoose, Express, NodeJS
body: <p>I'm trying to update an instantiated model ('Place' - I know it works from other routes) in a MongoDB and have spent a while trying to properly do so.  I'm also trying to redirect back to the page that views the 'place' to view the updated properties.  </p>
  
  <p>Node v0.4.0, Express v1.0.7, Mongoose 1.10.0</p>
  
  <p>Schema:</p>
  
  <pre><code>var PlaceSchema = new Schema({
  name  :String
  ,  capital: String
  ,  continent: String
  });
  </code></pre>
  
  <p>Controller/route:</p>
  
  <pre><code>app.put('/places/:name', function(req, res) {
  var name = req.body.name;
  var capital = req.body.capital;
  var continent = req.body.continent;
  Place.update({ name: name, capital: capital, continent: continent}, function(name) {
      res.redirect('/places/'+name)
  });
  </code></pre>
  
  <p>});</p>
  
  <p>I've tried a bunch of different ways but can't seem to get it.<br>
  Also, isn't how I declare the three {name, capital, and continent} variables blocking further operations?  Thanks. General debugging help is also appreciated.  Console.log(name) (right below the declaration) doesn't log anything.</p>
  
  <p>Jade form:</p>
  
  <pre><code>h1 Editing #{place.name}
  form(action='/places/'+place.name, method='POST')
    input(type='hidden', name='_method', value='PUT')
    p
      label(for='place_name') Name:
      p
      input(type='text', id='place_name', name='place[name]', value=place.name)
      p
      label(for='place_capital') Capital: 
      p
      input(type='text', id='place_capital', name='place[capital]', value=place.capital)
      p
      label(for='place_continent') Continent:
      p
      textarea(type='text', id='place_continent', name='place[continent]')=place.continent
      p
      input(type="submit")
  </code></pre>