title: Is it possible to rename a key in the Firebase Realtime Database?
body: <p>I was wondering, is there a way to update the key value?</p>
  
  <p>Let´s use the following data:</p>
  
  <p><a href="https://i.stack.imgur.com/3VYSg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3VYSg.png" alt="my data"></a></p>
  
  <p>I am using set() to write the data. 
  Now, I want the user to edit their <code>bookTitle</code> and it needs to change on both places. I tried using update() but I can´t seem to make it work. I can only edit the <code>bookTitle</code> in <code>bookInfo</code> NOT on <code>books</code>.</p>
  
  <p>Moving is not an option because it will erase the <code>bookData</code>.
  I also tried writing using push() but then, I can´t search properly because I don´t have the pushID (I need the search because users can't have two books with the same name)</p>
  
  <p>So, is there a way to update the key value?
  or, is there a better approach to this? I accept suggestions. Thank you!</p>
  
  <p><b>Update:</b> This is what I´m currently using to update the book title inside <code>bookInfo</code></p>
  
  <pre><code>var bookName = document.getElementById('bookName').value;
  
  firebase.database().ref('books/' + bookName + '/bookInfo').update({
      bookTitle : bookName
  });
  </code></pre>