title: Strongloop : Compare old model with the new instance in operation hook 'before save'
body: <p>I implemented a "before save" operation hook in my code to compare the new instance about to be saved with the old one already in the database.
  For that, I compare the value given in the ctx.data with the one given by a query in the database.
  The problem is the returned values are always similar, as if the new instance has already been saved in the database.
  Have I totally missed the point of the "before save" hook, or is there a way to compare the two values ?</p>
  
  <pre><code>module.exports = function(app) {
  
  var Like = app.models.Like;
  
  Like.observe('before save', function(ctx, next) {
  
      var count = 0;
      if (ctx.instance) { // create operation
          console.log('create operation);
      }
      else { // update operation
          // Query for the existing model in db
          Like.findById(ctx.where.id,
              function(err, item) {
                  if (err)
                      console.log(err);
                  else {//compare query value and instance value
                      if (item.value != ctx.data.value) {
                          // Always false
                      }
                      else {
                          //Always true
                      }
                  }
              }
          );
      }
      next();
  </code></pre>
  
  <p>I can't understand why item.value always similar to ctx.data.value as the first one is supposed to be the actual value in the db and the second one the value about to be saved.</p>