title: Firebase - how to get the key value in observeEventType = Value
body: <p>This is a follow up question to <a href="https://stackoverflow.com/questions/37807715/firebase-proper-way-to-structure-the-db">Firebase - proper way to structure the DB</a></p>
  
  <p>I have the following DB structure:</p>
  
  <pre><code>"artists" : {
    "-KKMkpA22PeoHtBAPyKm" : {
      "name" : "Skillet"
    }
  }
  </code></pre>
  
  <p>And I want to query the artists ref and see if an artist is already in the DB or not and if the artist IS in the DB, get the artist key (in the above example it would be <strong>-KKMkpA22PeoHtBAPyKm</strong>).</p>
  
  <p>I tried this:</p>
  
  <pre><code>artistsRef.queryOrderedByChild("name").queryEqualToValue("Skillet").observeEventType(.Value, withBlock: { (snapshot) in
          if snapshot.exists() {
              print("we have that artist, the id is \(snapshot.key)")
          } else {
              print("we don't have that, add it to the DB now")
          }
      })
  </code></pre>
  
  <p>but "snapshot.key" only gives me the parent key which is "artists".</p>
  
  <p>How can I get the key I need?</p>