title: "and" within "or" in PHP's MongoDB query
body: <p><a href="https://stackoverflow.com/questions/4884942/mongodb-and-or-combo">mongodb and or combo</a> Similar to this except I'm using php and getting [MongoCursorException] $or array must contain objects.</p>
  
  <p>Also read this <a href="http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24or" rel="nofollow noreferrer">http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24or</a></p>
  
  <p><strong>How can one nest an "AND" inside of an "OR" in MongoDB via PHP?</strong>  Here is my conditions argument (via var_export):</p>
  
  <pre><code>'group_id' =&gt; '4eec13b5-aeb4-48ee-9619-449125af0e18',
  '$or' =&gt; 
  array (
    0 =&gt; 
    array (
      0 =&gt; 
      array (
        'active' =&gt; 0,
        'user_id' =&gt; '4eea7b76-5d34-4036-8344-120c0aaa1bdc',
      ),
    ),
    1 =&gt; 
    array (
      1 =&gt; 
      array (
        'active' =&gt; 1,
      ),
    ),
  )
  </code></pre>
  
  <p>Need list of posts that are in a group id AND are active OR (belong to the user AND are not active).</p>
  
  <p>Extremely easy in SQL but whichever variation I try in the MongoDB via PHP query I get the $or error.  Is this possible?  Is an $and required?</p>