title: MongoDB check if value exists within array
body: <p>I'm using MongoDB inside a twig framework. I'm trying to determine if the user has access to a certain module. </p>
  
  <p>(a part of) my DB entry looks like: </p>
  
  <pre><code> _id: "579b50a4f5092761a20f4e71",
  approvedModules: [
   "examplemodule",
   "examplemodule1",
   "examplemodule2",
   "examplemodule3"
  ],
  </code></pre>
  
  <p>My code looks like:</p>
  
  <pre><code>session.get('__AUTH_USER').find({ approvedModules : { '$in' : ["examplemodule"]}}, { '$exists' : true })
  </code></pre>
  
  <p>(the standard functions have to be in quotes). </p>
  
  <p>I keeps returning false. I can only return the value if I use <code>session.get('__AUTH_USER').approvedModules.0</code> 
  I don't want to include the <code>.0</code> because that might change.</p>
  
  <p>What am I doing wrong? </p>
  
  <p>Thanks in advance!</p>