title: Mongodb nested array search
body: <p>document structure example is:</p>
  
  <pre><code>{
     "dob": "12-13-2001",
     "name": "Kam",
  
     "visits": {
       "0": {
         "service_date": "12-5-2011",
         "payment": "40",
         "chk_number": "1234455",  
      },
       "1": {
         "service_date": "12-15-2011",
         "payment": "45",
         "chk_number": "3461234",  
      },
       "2": {
         "service_date": "12-25-2011",
         "payment": "25",
         "chk_number": "9821234",  
      } 
    } 
  }
  
  
  {
     "dob": "10-01-1998",
     "name": "Sam",
  
     "visits": {
       "0": {
         "service_date": "12-5-2011",
         "payment": "30",
         "chk_number": "86786464",  
      },
       "1": {
         "service_date": "12-15-2011",
         "payment": "35",
         "chk_number": "45643461234",  
      },
       "2": {
         "service_date": "12-25-2011",
         "payment": "20",
         "chk_number": "4569821234",  
      } 
    } 
  }
  </code></pre>
  
  <p>In PHP i want to list all those "visits" information  (and corresponding "name" ) for which payment is less than "30". </p>
  
  <p>I want to print only the visits with "payment" &lt; "30" not others. Is such query possible, or do i have to get entire document first using search and then use PHP to select such visits??</p>