title: Loopback Mysql connector custom query result to field value
body: <p>I use Loopback 3 with Mysql. We have dynamic datamodel use. For example UserAnswers containing type like 'admin' or 'user'. I want to add count of answers to countOfAnswers field for types. </p>
  
  <p>Like:
  type 'admin' has 5 answers.
  type 'user' has 3 answers.</p>
  
  <p>I need to count type of answers before save to get current index for answers. Like <code>'Select * from UserAnswers where type = "admin"'</code>and insert it to field value. </p>
  
  <p>What is the best way to do counting or custom sql. Operation hook mayby? Or could I use custom field defination in model?</p>