Documentation

    How to use Firestore Studio, from the first connection to restoring a change.

    Import, export and collection operations

    Export and import JSON

    Write documents to a file and create documents from a file.

    1. Step 1: Select rows and choose More, Export, or open the collection More options menu and choose Export Collection.
    2. Step 2: In Export Data, choose the Source: Selected Docs, Collection, or Query Results. Query Results ignores the limit and exports every match.
    3. Step 3: Set the batch size (1 to 500) and choose Export JSON.
    4. Step 4: Choose where to save the file. The default name starts with firestore- and the collection name.

    The file is a JSON array with one object per document. Timestamps, geopoints and references are written as markers (__time__, __geo__, __ref__) so an import restores the types. Integers above 2^53 keep their exact digits. A single document is exported from its row menu with Export Document.

    Warning: Export does not include subcollections. If rows were loaded with Select or a reshaping pipeline, the file holds only the loaded fields, and the app warns you. A collection export runs as a background task. See Background tasks.

    To import documents from a JSON file:

    1. Step 1: Open the collection More options menu and choose Import. A tab named Import with the collection opens.
    2. Step 2: Check Target (project and collection).
    3. Step 3: Under Source File, choose Click to select a JSON file. The file can be an array of objects or a single object.
    4. Step 4: Read the review: Total Docs, With Custom ID, Auto-ID, Unique Fields and the field list.
    5. Step 5: Set the Batch Size (up to 500) and choose the Import N Documents button.

    Each object becomes a document. If an object has an id key, that is the document ID and it is not stored as a field. Without id, Firestore picks an automatic ID. To store a field named id, name it __id__ in the file. If two objects share an ID, the later one wins.

    The app refuses files that are not JSON, that contain an item that is not an object, or that contain no documents, and names the problem. Files written by Export import back with their types intact.

    Note: Import does not include subcollections. It runs as a background task, and Import Another File resets the page when it is done.

    Rename, move, duplicate, copy and delete a collection

    Operate on every document of a collection, in the same or another project.

    Open the collection More options menu in the path bar, or right-click the collection in the sidebar.

    ActionWhat it does
    Rename CollectionCopies all documents to a new collection path and deletes the originals.
    Move Collection toMoves all documents to a different collection path. The originals are deleted.
    Duplicate CollectionCopies all documents to a new collection path in the same project.
    Copy / Transfer CollectionCopies all documents to a collection in the same project, another database or another project.
    Delete CollectionDeletes all documents. Asks first and shows the account, project, database and collection.
    1. Step 1: Choose the action. The dialog shows From (Source) and To (Target).
    2. Step 2: Choose the target project, database and collection path.
    3. Step 3: Choose what happens when a target document already exists: Overwrite replaces it, Merge combines fields, Skip leaves it unchanged.
    4. Step 4: Leave Include subcollections on to copy or delete the nested collections as well, at all levels. Choose how to find them: As defined in the collection schema (fast, no document is checked) or Check every document.
    5. Step 5: Optional: change the Batch size (up to 500) and confirm. The operation runs as a background task.

    Warning: Rename, Move and Delete remove data. Delete Collection cannot be undone. The dialogs refuse a target that is the same as the source or inside it. With Include subcollections off, subcollections are not touched and stay in the database. With As defined in the collection schema, subcollections the schema does not define also stay where they are. The collection schema follows a rename, move or copy, and is updated when the task ends, also in the background.

    Copying to another project or database:

    Copy Document, Move Document, the bulk Copy and Move actions, and Copy / Transfer Collection can write to another database or another project. Under To (Target), pick the project. The list includes your Google, CLI, service account and emulator projects.

    1. Step 1: Open the dialog for the action you need.
    2. Step 2: Under To (Target), choose the Project, then the Database, then the collection or document path.
    3. Step 3: Check the conflict choice and Include subcollections.
    4. Step 4: Confirm. The task page shows both ends as account (database) and collection.

    Before it queues, the app checks that the target can be reached. If the host does not answer, the dialog says which one. You can tick Queue anyway to queue the task, which then fails until the target is reachable.

    Note: A MongoDB-compatible database is disabled as a target. The same permission rules apply as for a normal write: the identity of the target project must be allowed to write there.