title: Mongodb: Query a json-object nested in an array
body: <p>I'm quite new to mongodb and there is one thing I can't solve right now:<br>
  Let's pretend, you have the following document (simplified):</p>
  
  <pre><code>{
     'someKey': 'someValue',
     'array'  : [
         {'name' :  'test1',
          'value':  'value1'
         },
         {'name' :  'test2',
          'value':  'value2'
         }
      ]
  }
  </code></pre>
  
  <p>Which query would return the json-object, in which the value equals 'value2'?</p>
  
  <p>That means, i need this json-object:  </p>
  
  <pre><code>{
      'name' :  'test2',
      'value':  'value2'
  }
  </code></pre>
  
  <p>Of course I already tried a lot of possible queries, but none of them returned the right, e.g.  </p>
  
  <pre><code>db.test.find({'array.value':'value2'})
  db.test.find({'array.value':'value2'}, {'array.value':1})
  db.test.find({'array.value':'value2'}, {'array.value':'value2'})  
  </code></pre>
  
  <p>Can someone help and show me, what I'm doing wrong?<br>
  Thanks!</p>