title: I'm struggling to write this simple SQL query with mongo
body: <pre><code>SELECT * FROM table
  WHERE aaa = 321 AND bbb NOT IN (SELECT DISTINCT bbb
                    FROM table
                    WHERE ccc = 123)
  </code></pre>
  
  <p><code>aaa</code>, <code>bbb</code> and <code>ccc</code> are fields for the documents in the table and none of them are primary keys. </p>
  
  <p>I know I could do one query first and then map the results into an array that I could use in the second query, but there are a lot of records in the table and it's not feasible to load them all in memory to produce the array that I'd need. </p>
  
  <p>Tried playing with $lookup to write it all in a single query but I've not been able to do it :/</p>
  
  <p>Any help will be appreciated, cheers!</p>