How to get a list of all keys across all documents in a RethinkDB table?
<p>I have a dynamically populated table in which documents can have different keys that are not known in advance:</p>

<p><strong>Document 1</strong></p>

<pre><code>{
 'attribute1': 'foo',
 'attribute2': 'bar'
}
</code></pre>

<p><strong>Document 2</strong></p>

<pre><code>{
 'attribute1': 'foo',
 'attribute3': 'baz'
}
</code></pre>

<p>How can I get a list of all attributes present in all documents?</p>

<pre><code>attribute1
attribute2
attribute3
</code></pre>

<p>I've tried grouping by <code>keys()</code> but I get a list of the possible attribute combinations, not the individual keys.</p>