title: How to get auto Id after upsert on a persisted model in loopback?
body: <p>I have a some models generated from postgresql db using looback-connector postgresql. Id column of these models is a auto incremented integer column of postgresql db.</p>
  
  <p>1) I have a remote method added on one of persisted models, where i perform simple update or insert(upsert.</p>
  
  <pre><code> Car.CreateOrUpdateCar = function (carobj, req)     {
      Car.upsert(Carobj, function (err, Car) {
          if (err)
              console.log(err);
          else {
              req(err, Car);
          }
      });
  };
  </code></pre>
  
  <p>2) have  added a remote hook to execute after this remote method. </p>
  
  <pre><code>       Car.afterRemote('CreateOrUpdateCar', function (context, remoteMethodOutput, next) {
  //Remaining code goes here
        next();
          });
  </code></pre>
  
  <p>3) I want to use <strong>Id</strong> of newly inserted row in step (1), in the remote hook mentioned in step (2) </p>