title: firebase database read in batch - limit read of nested data
body: <p>I have this firebase database structure of <code>topics</code> * <code>tasks</code>. For each topic there are the same tasks with different records (tsX = some timestamp).</p>
  
  <pre><code>"topic1": {
    "task1": {
      "ts123": "record data",
      "ts212": "record data",
      ...
    },
    "task2": {
      "ts154": "record data",
      "ts223": "record data",
      ...
    },
  "topic2": {...},
  ...
  </code></pre>
  
  <p><strong>How can I retrieve for each combination of topic and task only at most X records ordered by timestamp? Expected result is the same tree but with limited number of leaves (records).</strong> </p>
  
  <p>Amount of <code>topics</code> * <code>tasks</code> could be around 100 * 50, so I'd like to avoid performing <code>#topics * #tasks</code> read operations. Is there any way to do that in one/batch read?</p>
  
  <p>(I'm using fb db client for web)</p>
  
  <p>THX!</p>