title: Assign a result from promise to an external variable
body: <p>I'm using promise to get a value from DB, and I want to search db for a value retrieved after a form submission (req.body.country), get its id and assign it to a variable declared out of the promise, how to get it?
  Here's the code:</p>
  
  <pre><code>var newAddress = new Address(); // Address is a mongoose model.
  newAddress.city = req.body.city;
  newAddress.state = req.body.state;
  Country
    .findOne({name: req.body.country})
    .then(function (result) {
      newAddress.country = result;
    })
    .catch(function(err) {
      res.send(500, {message: 'Failed to search into DB'});
    });
  
  newAddress.save(function (err, result) {
     if(err) {
       res.status(500).send('Failed to save the newAddress to DB: ' + err);
     }
  });
  </code></pre>
  
  <p>This is the mongoose address model:</p>
  
  <pre><code>var addressSchema = new Schema({
    street1: {type: String, required: true},
    street2: String,
    city: String,
    state: String,
    zip: String,
    country: {type: Schema.Types.ObjectId, ref: 'Country'},
    lat: String,
    long: String
  });
  </code></pre>
  
  <p>Everything is inside nested callbacks, I'm trying to move from callbacks to Promise.
  I've no error, it simply doesn't save the country in the address as newAddress inside the promise is not the same newAddress declared at the code beginning</p>