title: Counter of children in master detail
body: <p>In my data structure I a Master elements that contain children Detail elements (one-to-many), something like that:</p>
  
  <pre><code>/myapp/masters/1234/details/5678
  /myapp/masters/1234/details/3456
  /myapp/masters/6789/details/9876
  </code></pre>
  
  <p>Now when I display a list of masters in a table view in my ios app, I would like to display the number of children under each master element:</p>
  
  <ul>
  <li>1234 (2)</li>
  <li>6789 (1)</li>
  </ul>
  
  <p>What is the best way to do that efficiently with Firebase? Should I keep a counter inside the element stored at the master level and update it transactionally every time a new detail is appended to it? Other strategy?</p>