title: Retrieve a single property from document
body: <p>Good day everyone.
  Suppose we have a collection and a document which looks something like this:</p>
  
  <pre><code>    test_doc = {
      "ID" : "123",
      "a" : [
                      {
                          'x' : "/",
                          'y' : "2000",
                          'z' : "1000"
                      },
                      {
                          'x' : "/var",
                          'y' : "3500",
                          'z' : "3000"
                      }
             ]
  
        }
  </code></pre>
  
  <p>What i need is to retrieve a single property a.z .
  In MongoDB i'm using the following query:</p>
  
  <pre><code>db.testcol.find({"ID":"123","a.x":"/"},{'a.z':1})
  </code></pre>
  
  <p>which returns this: </p>
  
  <pre><code>{ "_id" : ObjectId("skipped"), "a" : [ { "z" : "1000" }, { "z" : "3000" } ] }
  </code></pre>
  
  <p>As you can see it returns all the z properties, but i need only the first one or the second when condition is <code>{"ID":"123","a.x":"/var"}</code>
  So, the question is: how do i get a single property in this situation? Is it just a matter of bad design or should i somehow process the returned document in code (python)? Any suggestions will be much appreciated.</p>