i am using Firebase and Node.

I would like to use the same method to either update an object, or create it, if for some reason it does not exist. 

Consider the following method

```
const firebaseSave = async function(data) {   
    const uid = firebase.auth().currentUser.uid

    const profilePath = `users/${uid}`
    const profileData = {
      name: data.name,
    }

    const userRef = firebaseDb.child(profilePath)
    await userRef.set(profileData)

  }

```

What would be the best and correct way to determine if update or set should be called? 

thanks