title: Swift, Firebase. Checking if name already exist doesn't work
body: <p>I'm trying to make an app, where you have to choose a team name, and when the user enter his/hers team name, I want to check if the name already is in use.</p>
  
  <p>teamNameTextField is a <code>UITextField</code> and for some reason no matter what I type in the text field, it prints "Team name is not in use". I don't know what I'm doing wrong here, can somebody help me?</p>
  
  <p>My code:</p>
  
  <pre><code>rootRef.child("teams").queryOrderedByChild("teamName").queryEqualToValue(teamNameTextField.text).observeSingleEventOfType(.Value, withBlock: { (snap) in
  
      if (snap.value is NSNull) {
          print("Team name is not in use")
      } else {
          print("Team name is already in use")
      }
  })
  </code></pre>
  
  <p>my JSON data tree:</p>
  
  <pre><code>{
    "teams" : {
      "pbXvXYOKmJQqwSQZ9IlBykG7x1P2" : {
        "teamName" : "Test111"
      },
      "owidUDkEnbCOsmNSoSFu2o2iu4y38RKJNF" : {
        "teamName" : "Test222"
      },
      "pdnJCDmcdjsiHDFb8349HGD8372bfdhb" : {
        "teamName" : "Test123"
      }
    }
  }
  </code></pre>
  
  <p>My database rules:</p>
  
  <pre><code>{
    "rules": {
      ".read": true,
      ".write": true
    }
  }
  </code></pre>