Run the query first
- Open the collection and add filters for the documents you want to change, for example
status == trial. - Choose Run. The job uses the query of your last Run, not filters you've typed since, so run it again after any change.
- Right-click the header of the column you want to change. The menu has Set a value in documents…, Rename field in documents… and Delete field from documents….
Each dialog lets you choose Every document matching this query or Selected rows. "Every document" means everything the query matches, not only the rows on screen. In a JS Query tab, only Selected rows is available.
These items show Pro and are greyed out in the Free edition. They're also off if your role for the project is Viewer or the project is marked read-only.
Set a value in documents
- Field starts as the column you clicked. Type another name to add a new field. Use dots for a field inside a map, such as
address.city; the rest of the map is kept. - Choose the Type:
Type What to enter Auto Firetool works out the type from what you type. Text Any text, kept as a string, even if it looks like a number. Number A number. Long whole numbers are kept as exact 64-bit integers. True / false truefor true; anything else is false.Null Nothing: the value is null. Timestamp A date and time, such as 2026-10-01T00:00:00Z.Reference A document path, such as users/alice.JSON (map or array) A JSON value, such as {"plan": "pro", "seats": 5}or["a", "b"]. - Enter the Value.
- Tick Only documents that don't have this field yet to fill in a missing field without touching documents that already have it.
Documents that already hold exactly that value, with the same type, aren't written.
Add a number, convert a type, or a new ID
In Set a value in documents…, the Change box has three more choices:
- Add a number (or subtract): adds the amount to the field in every document; a document without the field gets the amount. Text and other values are left as they are. Whole numbers stay exact, however large.
- Convert to another type: text such as
"42"becomes a number, numbers become text, dates such as2026-01-05(or a count of milliseconds) become timestamps, and yes/no or true/false become true or false. A value that can't be converted is left as it is and counted in the preview. - A new random ID in each document: a UUID as text, in every document or only where the field is missing.
- Find and replace text: every place the text appears in the field is replaced, matching upper and lower case or not. Leave Replace with empty to remove the text. Only text values change; the preview counts the documents where the text doesn't appear and the ones whose value isn't text.
The preview shows the exact new values, and each write checks that the document hasn't changed since, as for the other changes.
Rename field in documents
- Type the New name. Use dots to move the field into a map, such as
address.town. The value moves as it is, with its type. - Under If a document already has the new name, choose Leave that document as it is or Replace its value.
Documents that don't have the field are skipped. A field can't be renamed into itself or into the map it's in.
Delete field from documents
Choose the scope and preview. Only that field is removed; the rest of each document stays. Documents without the field are skipped.
Preview, then apply
- Choose Preview. Nothing is written yet. Firetool first counts the matching documents; if there are more than 10,000, it shows the number of reads and asks before going on.
- The preview says how many documents will change and why the others won't (they don't have the field, already have the value, or already have the new name). It also says how many writes that is and how many documents the preview read.
- A table shows up to five documents with the field before and after.
- Choose the button that names the change, such as Set in 1,240 documents, Rename in … or Delete in ….
Changing anything in the dialog clears the preview, so what you apply is always what you previewed.
Firetool writes in batches of 500 and shows how many have changed. Cancel stops after the current batch; the button then reads Resume and continues where it stopped. When it's done, the tab runs the query again so you see the result. In Tools → Tasks you can also pause the job, see the time left and cancel it.
How the writes stay safe
- Only the changed field is sent. Each write names just that field (and, for a rename, the new one), so other fields aren't overwritten.
- Documents changed since the preview are skipped. Every write carries the document's last update time from the preview. If someone changed or deleted the document since, Firestore refuses that write, and Firetool counts it as "skipped (changed after the preview)". Preview again to include them.
- Busy errors are retried. Writes that fail only because Firestore is busy are sent again with a pause.
- Production asks first. If the project or database is marked production, you type the project ID once before the job writes.
- Rules apply. Read-only collections, required reasons and the audit log apply as for any change. The job also appears in Tools → Tasks with the reads and writes it cost.
Save it to run again
Choose Save… in the dialog to keep the change with the query of your last Run. Tools → Tasks → Saved then runs it again on the same or another project (staging first, then production) with the same preview and checks, or exports it as a Node.js script. See Saved changes and scripts.
Undo a change
For Set, Rename and Delete field, Firetool keeps a copy of each document as it was before the change in the audit log, unless your policy turns copies off. Open Tools → Audit log, click an entry for the job (one per batch) and choose Restore N documents. That writes the old versions back, replacing any changes made since.
The same change with a JS Query
For a change the dialogs don't cover, such as working out each new value from other fields, use a JS Query (also Pro). A batch holds at most 500 writes:
// Move trial users to the free plan and remove an old field
const snap = await db.collection("users")
.where("plan", "==", "trial")
.limit(500)
.get();
const batch = db.batch();
snap.forEach((doc) => batch.update(doc.ref, {
plan: "free",
legacyFlag: FieldValue.delete(),
}));
await batch.commit();
return `${snap.size} documents updated`;
Run it again until it reports 0. A script has no preview and doesn't check whether a document changed since it was read, so try it on a test project first. In a production project you type the project ID before a script runs.
Questions
Can I change a field inside a map?
Yes. Use dots in the field name, such as address.city. For Set, the other fields in the map are kept. For Rename, you can also move a field into or out of a map.
What if the job stops halfway?
The documents already changed stay changed. Choose Resume to continue with the rest of the same preview. Documents edited by someone else in the meantime are skipped, not overwritten.
Related
- Firestore bulk operations: bulk changes, copies and deletes in Firetool.
- Query Firestore: build the query that picks the documents.
- JS Query: scripts in the style of the Admin SDK.
- Back up and restore: keep a copy before a big change.
- Saved changes and scripts: run a change again, or as a script.