title: Mongodb php query, search in array?
body: <p>I am looking for a way to search for a keyword (ex. "Henrik") in the "answers" array of documents with the following structure</p>
  
  <pre><code>Array
  (
  [_id] =&gt; MongoId Object
      (
          [$id] =&gt; 4eeedd9545c717620a000007
      )
  
  [formId] =&gt; 6
  [respId] =&gt; 4eeedd95c93228
  [dateCreated] =&gt; 2011-10-14 07:45
  [answers] =&gt; Array
      (
          [field1] =&gt; Henrik
          [field6] =&gt; myemail@domain.com
          [field7] =&gt; my city address
      )
  
  )
  </code></pre>
  
  <p>I am working in PHP on this project, and quering like this works of course:</p>
  
  <pre><code>$answers = $collection-&gt;find( array('formId' =&gt; 6, 'answers.field1'=&gt; 'Henrik' ) );
  </code></pre>
  
  <p>What I want to do is search without a specific key of the answers array, like this</p>
  
  <pre><code>$answers = $collection-&gt;find( array('formId' =&gt; 6, 'answers'=&gt; 'Henrik' ) );
  </code></pre>
  
  <p>Is it possible to do this type of query?
  I am sorry if this is a repost. I was not able to find any examples about this here or on Google.</p>