title: Rethinkdb multiple level grouping
body: <p>Let's say I have a table with documents like:</p>
  
  <pre><code>{
    "country": 1,
    "merchant": 2
    "product": 123,
    ...
  }
  </code></pre>
  
  <p>Is it possible to group all the documents into a final json structure like:</p>
  
  <pre><code>[
    {
      &lt;country_id&gt;: {
        &lt;merchant_id&gt;: {
          &lt;product_id&gt;: &lt;# docs with this product id/merchant_id/country_id&gt;,
          ... (other product_id and so on)
        },
        ... (other merchant_id_id and so on)
    },
    ... (other country_id and so on)
  ]
  </code></pre>
  
  <p>And if yes, what would be the best and most efficient way?
  I have more than a million of these documents, on 4 shards with powerful servers (22 Gb cache each)</p>
  
  <p>I have tried this (in the data explorer, in JS, for the moment):</p>
  
  <pre><code>r.db('foo')
    .table('bar')
    .indexCreate('test1', function(d){
      return [d('country'), d('merchant'), d('product')]
    })
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>r.db('foo')
    .table('bar')
    .group({index: 'test1'})
  </code></pre>
  
  <p>But the data explorer seems to hang, still working on it as you can see...</p>