MongoDB "select x from y where id in" another table
You should use $lookup for subquery.
Check out the document.
There is an example from the document.
db.collection1.aggregate([
{
   $lookup:
     {
       from: &lt;collection to join&gt;,
       localField: &lt;field from the input documents&gt;,
       foreignField: &lt;field from the documents of the &quot;from&quot; collection&gt;,
       as: &lt;output array field&gt;
     }
}