lang-kotlin">Query.asFlow()</code> builds on top of <code class="lang-kotlin">Query.queryChangeFlow()</code> to emit non-null <code class="lang-kotlin">ResultSet</code>s and throw any <code class="lang-kotlin">QueryChange</code> errors.</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">select(all())<br>    .from(collection)<br>    .where { "type" equalTo "user" }<br>    .asFlow()<br>    .collect { value: ResultSet -&gt; <br>        // consume ResultSet<br>    }</code></pre><