Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

check if a user already exists firebase realtime database react native

const { email, username, password } = this.state;

let rootRef = firebase.database().ref();

rootRef
  .child('users')
  .orderByChild('username')
  .equalTo(username)
  .once('value')
  .then(snapshot => {
    if (snapshot.exists()) {
      let userData = snapshot.val();
      console.log(userData);
      Alert.alert('username is taken');
      return userData;
    } else {
      console.log('not found');
      firebase
        .auth()
        .createUserWithEmailAndPassword(email, password)
        .then(async user => {
          console.log('Data created', user);
        });
    }
});
Comment

PREVIOUS NEXT
Code Example
Typescript :: laravel Adding shipping rate to checkout session results in "invalid array" exception 
Typescript :: ips in range typescript 
Typescript :: move between points in godot 
Typescript :: that asks for a two digit number and then prints the english word for the number 
Typescript :: code solutions online for public IActionResult Student() { return View(Students Controller 1); } 
Typescript :: useScreenWidth 
Typescript :: how to reorder boxplots in ggplot 
Typescript :: how to print the elements of a array using range based for loop 
Typescript :: how to create nest without spec test filefile 
Typescript :: PYTHON STACK FUNCTION count the valid number of brackets Returns the total number of valid brackets in the string 
Typescript :: What are the tables in test plans? 
Typescript :: description of capillary walls 
Typescript :: turn milliseconds to human readable string typescript 
Typescript :: how to use indexOf in typesript 
Typescript :: real time charts in flutter 
Typescript :: typescript read url search params 
Typescript :: tiqets endpoints 
Typescript :: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 
Cpp :: how to list environments with conda 
Cpp :: print 2d vector c++ 
Cpp :: how to complie with c++ 17 
Cpp :: std::string to qstring 
Cpp :: c++ short if 
Cpp :: check compiler version c++ 
Cpp :: sum vector c++ 
Cpp :: cv2.threshold c++ 
Cpp :: c++ writing to file 
Cpp :: c++ string to wstring 
Cpp :: rotate in cpp 
Cpp :: priority queue c++ time complexity 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =