Filter nested documents in meteorjs
<p>I am having some trouble when trying to filter nested documents in Meteor, and I don't want to use MongoDB Aggregation to unwind my documents.</p>

<p>An example of my Users document</p>

<pre><code>{
   Publications:[{ 
       type:1
   },{ 
       type:2
   }]
}
</code></pre>

<p>When I do a find to get only type 1, I get the expected result - they return only the User documents who have a type 1 publication, but they also return the publications with type 2 too, because they are in the publications array of that User.</p>

<p>I can make a loop in the results to remove these publications manually before publishing, but I don't think this is the right approach.</p>

<p>Can someone please help guide me to a better solution?</p>

<pre><code>Edited
</code></pre>

<p>The Sean answer is good but not the right yet, the projection dont work on meteor. That work on robomongo, but in the project still returning the 2 publications types of the user.</p>