select 2 fields and return a sorted array with their distinct values
<p>Say we have the following docs:</p>

<pre><code>{a: 1, b: 2},
{a: 2, b: 0},
{a: 3, b: 1}
</code></pre>

<p>I want a query that will return:</p>

<pre><code>[0, 1, 2, 3]
</code></pre>

<p>I want to know if there is a way to do this faster than:</p>

<ul>
<li>just making 2 queries, one selecting <code>a</code>, the other selecting <code>b</code> then merging in my application.</li>
<li>using map reduce(which was reaaaaly slow compared to the previous method)</li>
</ul>