title: firebase query by array of child
body: <p>I have this document structure</p>
  
  <pre><code>{
    "parking" : {
      "-Kace9LLJBuhG1RBWsy2" : {
        "address" : "avenida",
        "company_name" : "Company",
        "hours" : 40,
        "owner" : "Fmex7wiYAsbxNFhDy39X1r28J9L2",
        "receipts" : [
           {
            "id" : "-KbB-0Wxxx_vsCxy",
            "date" : "3/01/2017",
            "user_id" : "Fmex7wiYAsbxNFhDy39X1r28J9L2",
            "value" : 50
          },
          {
            "id" : "-KbB-0Wzzzz_vsCy",
            "date" : "3/30/2017",
            "user_id" : "Fmex7wiYAsbxNFhDy39X1r28J9L2",
            "value" : 50
          }
        ],
        "social_name" : "Company",
        "value" : "50"
      },
  </code></pre>
  
  <p>Is it possible for me to pick up a parking lot, using the id of a receipt?
  Example: I want to show the user a parking only if the user ID is inside the receipts array</p>
  
  <p>Or do not you want to do this with the firebase and I would have to create a reference instead of a subdocument?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've tried something like:</p>
  
  <pre><code>var refParkingByUser = firebase.database().ref('parking').orderByChild('receipts').equalTo(Auth.$getAuth().uid);
  </code></pre>
  
  <p>But how do I access the receipt elements?</p>