Rename Document / Change Document ID

Rename Document / Change Document ID

Cloud Firestore has amazing realtime and scaling capabilities, but the official Firebase Console is missing some essential features like the ability to rename documents. Previously you had to create a new document with the same data and delete the old document manually or write a script that does this for you. When the document contained subcollections, they needed to be transferred to the new document as well.

Step by Step Instructions For Renaming a Document

  1. Click the collection in the sidebar on the left.
  2. Find the document in the output table. If the document is not visible right away, you can click load more until it is visible. If your collection has too many documents, use the Where, Order by or Limit fields and click Run to find it. Another alternative is to enter the document path directly in the Path field, e.g. myCollection/myDocumentId and click the Run button.
  3. Right-click on the left-most cell (ID column) of the document and choose Rename Document.
    default
  4. Change the last part of the Target Path to the new document name.
    default
  5. That’s it! Confirm with OK.

Notes

Collections and Subcollections can be renamed in the exact same way. If your document contains subcollections, Firefoo will automatically copy them over to the new location, which might take some time. You can track the progress in the Tasks popup, reachable through File › Tasks.