title: MongoDB get all values of 1 field
body: <p>So I know that  in mongodb, I can get all values and then iterate through them but I was wondering if in mongodb there is an option to get only a certain field.</p>
  
  <p>So for example suppose my collection is structured as follows:</p>
  
  <pre><code>{_id:
      {
      field1,field2,field3}
      }
  {description:
      {
      field1,field2,field3,
      data:{
      field1,field2,field3
      }
      }
      }
  {otherdata:
  {field1,field2,field3}
  }
  </code></pre>
  
  <p>Now, I need the value of description.data.field1 so any suggestions on how to do that?</p>
  
  <p>So far I have tried using following commands:</p>
  
  <pre><code>db.module.collection.description.data.find()
  db.module.collection.description.find({'data':1})
  db.module.collection.find('description.data.data':1})
  </code></pre>
  
  <p>But obviously, they did not work.</p>
  
  <p>Any suggestions?</p>