title: How to check if data exists in firebase using angularfire?
body: <p>I would like to register users manually in firebase. How can i check if the user is registered already or if his ( USERID ) exists? If it exists it should not let him register otherwise if his userid is not yet on the database then his info should be saved. Here is my current code wherein only saving userinfo is still available.</p>
  
  <pre><code>$scope.details={};
  
  $scope.registerme= function() {
  var someDate = new Date();
  var ref = firebase.database().ref('/Users/');
  $scope.submitme = $firebaseArray(ref);
  
  
              $scope.submitme.$add({
              facebookid: $scope.details.userid,
              firstname: $scope.details.firstname,
              lastname: $scope.details.lastname,
              timestamp: someDate.toString(),
              }).then(function(ref) {
              alert('Registration success.');
              }).catch(function(error) {
              alert('Registration Failed.');
              });
  
  };
  </code></pre>