title: Panache with MongoDB find distinct
body: <p>I have documents with &quot;tags&quot; arrays as properties. Now I want to query all distinct tag-items.</p>
  <pre><code>{ 
    &quot;name&quot;: &quot;test1&quot;,
    &quot;tags&quot;: [&quot;tag1&quot;,&quot;tag2&quot;, &quot;tag3&quot;]
  },
  {
    &quot;name&quot;: &quot;test2&quot;,
    &quot;tags&quot;: [&quot;tag1&quot;]
  }
  </code></pre>
  <p>Solution in mongo shell:</p>
  <pre><code>db.ApiModel.distinct(&quot;tags&quot;)
  
  </code></pre>
  <p>which gives me:</p>
  <pre><code>[&quot;tag1&quot;, &quot;tag2&quot;, &quot;tag3&quot;]
  </code></pre>
  <p>But how can I achieve the same result with Panache? The PanacheMongoEntity does not offer a specific distinct method. Nor do i know how to use the <code>find</code> method to achieve my goal or if it even is possible using this method.</p>
  <p>All I could possibly think of is finding all tags with <code>find(&quot;tags&quot;, &quot;*&quot;)</code> (is * the wildcard?) and then dealing with duplicates in Java, but I don't believe that's the intended use.</p>