title: How to get a mongoose query to return only specific field inside of a document using Mongoose/ MongoDB?
body: <p>I'm trying to code a menu manager where I can update delete and create both new menu items and categories. I need to get a query to return only the menu-items not all of the other category data inside of the document.</p>
  <p>How can I do that?</p>
  <p>This is the schema:</p>
  <pre><code>{
     Categories:
       name: ffjs,
       id: fhsjd,
       menu_items: [
         item1: {
           name: fhrse,
           ingredients: [jksf,sjdfk,fjd]
         }, ...
      ]
  }
  </code></pre>
  <p>I would like the query to just return item1, item2, item3 and so on, but can't get the query to work.</p>
  <p>I have tried:</p>
  <pre><code>Categories.find({&quot;items&quot; : $all})
  Categories.find({}).select(&quot;items&quot;)
  </code></pre>
  <p>I've also tried querying for specific items just to test and only ever returns the full document such as :</p>
  <pre><code>Categories.find({&quot;items.name&quot; : &quot;ramen&quot;})
  Categories.find({items :{&quot;$elemMatch&quot; : {name: &quot;ramen&quot;}}}, {&quot;items.name&quot; :1})
  </code></pre>