title: Create new if doesn't exist else update in firebase
body: <p>I am using firebase as database for my mobile app created using react native. In one scenario , i need to check that if the child already presented ? if not create a new child else update the existing child. </p>
  
  <p>I have a tree named "CouponUsage", and it has all the users who used coupon code.</p>
  
  <p>The structure of the tree is as follows: </p>
  
  <pre><code>   -CouponUsage
         -user1
            -coupon1: 0    // couponcode name and Number of times used
         -user2
            -coupon1: 2
            -coupon2: 0
  </code></pre>
  
  <p>So, what i want is, i need to check if "user1" or "user2" already existed ? And if they are not existed a new entry with "user1" or "user2" should be created with respective couponcode which they have entered.</p>
  
  <p>The whole scenario is, user will enter couponcode in the app, and i am validating the code and then once correct, the coupon code will be sent to google cloud function, and then the above said thing will happen. So, that once the user entered coupon code ( every coupon code has separate user usage limit ), the code will be sent , and the function should check if the "user1" is already exist and if exist, the user entered code already exist ? And if that exist then just update the counter else create "user1" and add a child of "coupon1" ( coupon entered by user ) and then start the counter with 1.</p>
  
  <p>Here is my code on google cloud function as of now ! :</p>
  
  <pre><code> if(usersCouponUsage) {
              await admin.database().ref(`couponUsage/${phone}`)
              .update({ [couponCodeName]: usersCouponUsage + 1 });
          }
  </code></pre>
  
  <p>Its clearly updating the count, if i pass the count also. How to implement the above said in firebase ? </p>