title: Update data in firebase object
body: <p>I want to update some data in an object in my firebase database, but have been unsuccessful so far.</p>
  
  <p>I have been following the documentation to the point, but can't seem to get it right.. I'm fairly new to firebase, but this shouldn't be a huge problem.</p>
  
  <p><a href="https://i.stack.imgur.com/Wkvoq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wkvoq.png" alt="enter image description here"></a></p>
  
  <p>My structure looks like this.</p>
  
  <p>And this is how i have been trying to solve it:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>userRef.on("value", function(snapshot) {
   var user = firebase.auth().currentUser;
   var key = user.uid;
     var getUser = snapshot.val();
     var userData = Object.keys(getUser);
   var userKey = userData[0];
   console.log(userKey);
  
   var db = firebase.database();
   var ref = db.ref("sofit-8ad52/profiles");
   console.log(key);
   var usersRef = ref.child(key);
   usersRef.set({
     userKey: {
       Username: "TEST",
     },
   });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Would love some help on this one.</p>