title: Updating object property with value of Promise
body: <p>I using Express with Node to interact with a MySQL database. 
  The <code>create</code> method of my Card object will save the data to the database and should update the object's id to be the insertId returned from the query.</p>
  
  <pre><code>class Card {
      constructor(d) {
          this.id = d.id || 0;
          this.playerId = d.playerId;
          this.drawn = false;
          this.title = d.title
          this.qty = d.qty;
          this.hint = d.hint;
          this.type = d.type;
          this.descr = d.descr;
          this.pair = d.pair
          this.data = d;
      }
  
      create(conn) {
          return new Promise( (resolve, reject) =&gt; {
              var query = "INSERT INTO cards SET ? ";
  
              conn.query(query, this.data, function(err, result) {
                  if (err) throw err;
                  (typeof result.insertId === 'number')
                      ? resolve(result.insertId)
                      : reject("Failed to insert a new Card.");
                  resolve(result.insertId);
              })
  
          }).then( (id) =&gt; {
              this.id = id;
              console.log("Your insert id is");
              console.log(this.id) // GREAT! It prints the correct id
              return this; // Set the value of the promise to this Card instance
          })
      }
  
  } 
  </code></pre>
  
  <p>After creating a card, it should print the json representation of the card.</p>
  
  <pre><code>router.post('/create-card', function(req, res) {
      var data = req.body;
      var card = new Card(data);
      card = card.create(db.connection);
      res.json(card);
  })
  </code></pre>
  
  <p>But the <code>id</code> of the returned object is always the default value (0).</p>
  
  <p>I have played with a few different ways of trying to capture the id, set the object's id property with the new value, and persist that value to the object. However, it always seems to be a more locally scoped version of the card that gets updated, not the original card (which is printed to the page). </p>
  
  <p><strong>When using Promises, what is the proper place to assign object data and return that instance of the object?</strong></p>