title: PUT route with Node.JS
body: <p>I am new here and I have a problem, I hope you can help me :).</p>
  
  <p>I have the following AJAX in my client side that sends the data to update the database:</p>
  
  <pre><code>$.ajax({
   type: 'PUT',
   url: host + '/database',
   data {
    name: 'MisterX',
    email: 'mister.x@gmail.com
   },
   sucess:function(sucess) {
    alert('sucess');
   },
   err:function(err) {
    console.log(err);
   }
  });
  </code></pre>
  
  <p>Them, in my routes file i have:</p>
  
  <pre><code>app.put('/database', function(req, res) {
          require('data', function (data){
              var database = data;
  
              database.save(function (err) {
                  if(err) {
                      console.log('err', err);
                  }
                  res.status(200).json('ok');
                  console.log('Database updated');
              });
          });
      });
  </code></pre>
  
  <p>This put route was completely done in theory, I do not know exactly how to take the data and updates them in my database</p>
  
  <p>My schema:</p>
  
  <pre><code>var databaseSchema = mongoose.Schema({
          name: String,
          email: String,
      });
  </code></pre>
  
  <p>If someone can give me a direction, I appreciate it.</p>
  
  <p>Thanks.</p>